Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 10d481cacbc06f925476997e0b4b23548e166812 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import org.eclipse.gmf.internal.codegen.util.CodeGenerationUtils;

modeltype genModel uses "http://www.eclipse.org/gmf/2008/GenModel";

library Metrics;

helper getNotationMetrics(c : genModel::GenMetricContainer) : Sequence(genModel::GenMetricRule) {
	return c.metrics->select(m | not (Sequence { m.target })[genModel::GenNotationElementTarget]->isEmpty())->asSequence()
}

helper getDiagramMetrics(c : genModel::GenMetricContainer) : Sequence(genModel::GenMetricRule) {
	return c.metrics->select(m | not (Sequence { m.target })[genModel::GenDiagramElementTarget]->isEmpty())->asSequence()
}

helper getDomainMetrics(c : genModel::GenMetricContainer) : Sequence(genModel::GenMetricRule) {
	return c.metrics->select(m | not (Sequence { m.target })[genModel::GenDomainElementTarget]->isEmpty())->asSequence()
}

helper exprFieldName(m : genModel::GenMetricRule) : String {
	return 'expression' + validJavaIdentifier(m.key).firstToUpper()
}

helper calcMethodName(m : genModel::GenMetricRule) : String {
	return 'calc' + validJavaIdentifier(m.key).firstToUpper()
}

Back to the top