public class AbstractProcedure
extends java.lang.Object
Constructor and Description |
---|
AbstractProcedure() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
evalBooleanExpression(ModelElement element,
ExpressionNode node,
Variables vars)
Calculates the value of a boolean expression for a model element.
|
protected java.util.Collection<ModelElement> |
evalElementSetExpression(ModelElement element,
ExpressionNode node,
Variables vars)
Calculates a set expression that returns a set of model elements.
|
protected java.lang.Object |
evalExpression(ModelElement element,
ExpressionNode node,
Variables vars)
Calculates the value of a metric expression for a model element.
|
protected java.util.Collection<?> |
evalSetExpression(ModelElement element,
ExpressionNode node,
Variables vars)
Calculates a set expression for a model element.
|
protected FilterAttributeProcessor |
getFilterAttributeProcessor(ProcedureAttributes attributes)
Creates a new filter attribute processing object.
|
protected MetaModel |
getMetaModel()
Gets the metamodel for which this calculation takes place.
|
protected MetricsEngine |
getMetricsEngine()
Gets the metrics engine to use for calculations.
|
protected Model |
getModel()
Gets the model for which this calculation takes place.
|
protected java.util.Collection<ModelElement> |
getRelationOrSet(ModelElement element,
ProcedureAttributes attributes,
Variables vars)
Gets the element set specified by a "relation" or "relset" attribute.
|
protected boolean |
isCompatible(ModelElement element,
MetricEntry metric,
ModelElement candidate)
Checks if a metric or set can be applied to a related element.
|
protected MetricsEngine getMetricsEngine()
protected java.util.Collection<ModelElement> getRelationOrSet(ModelElement element, ProcedureAttributes attributes, Variables vars) throws SDMetricsException
element
- Element for which to retrieve the set.attributes
- Attributes of the procedure definition.vars
- Variables for the evaluation of expressionsSDMetricsException
- Neither "relation" nor "relset" attribute was
specified.protected FilterAttributeProcessor getFilterAttributeProcessor(ProcedureAttributes attributes) throws SDMetricsException
attributes
- Attributes of the procedure definitionSDMetricsException
- One of the filter attributes contains illegal
valuesprotected Model getModel()
protected MetaModel getMetaModel()
protected java.lang.Object evalExpression(ModelElement element, ExpressionNode node, Variables vars) throws SDMetricsException
element
- The model element to evaluate the expression for.node
- Root node of the expression to evaluatevars
- Variables for the expression evaluationSDMetricsException
- a problem occurred during the evaluationprotected boolean evalBooleanExpression(ModelElement element, ExpressionNode node, Variables vars) throws SDMetricsException
element
- The model element to evaluate the expression for.node
- Root node of the expression to evaluatevars
- Variables for the expression evaluationSDMetricsException
- a problem occurred during the evaluationprotected java.util.Collection<?> evalSetExpression(ModelElement element, ExpressionNode node, Variables vars) throws SDMetricsException
element
- The model element to evaluate the expression for.node
- Root node of the expression to evaluatevars
- Variables for the expression evaluationSDMetricsException
- a problem occurred during the evaluationprotected java.util.Collection<ModelElement> evalElementSetExpression(ModelElement element, ExpressionNode node, Variables vars) throws SDMetricsException
element
- The model element to evaluate the expression for.node
- Root node of the expression to evaluatevars
- Variables for the expression evaluationSDMetricsException
- a problem occurred during the evaluationprotected boolean isCompatible(ModelElement element, MetricEntry metric, ModelElement candidate)
element
- The element for which the metric/set/rule is calculated.metric
- The metric, set, or rule to be checked.candidate
- The related element to check.true
if the metric/set/rule can be applied to the
candidate element, else false