Package com.nomagic.magicdraw.evaluation
Interface Evaluator
- All Known Subinterfaces:
BinaryEvaluator
@OpenApi
public interface Evaluator
A basic expression evaluator interface. Implementers should realize
the method to evaluate expression
-
Method Summary
Modifier and TypeMethodDescriptionevaluate
(OpaqueExpression expression, Element object) Entry method for expression evaluation.default Object
evaluate
(OpaqueExpression expression, Element object, List<NamedArgument> arguments) Entry method for expression evaluation.getExpressionCachingKey
(OpaqueExpression expression) Calculates a string identifier of the expression.boolean
isExpressionGlobal
(OpaqueExpression expression) Determines if the supplied expression is "global", i.e.
-
Method Details
-
evaluate
Entry method for expression evaluation. Takes expression, contextual object and produces result.- Parameters:
expression
- expression to be calledobject
- contextual object of expression call- Returns:
- expression evaluation result
-
evaluate
@OpenApi default Object evaluate(OpaqueExpression expression, @CheckForNull Element object, List<NamedArgument> arguments) Entry method for expression evaluation. Takes expression, contextual object, additional arguments and produces result.- Parameters:
expression
- expression to be calledobject
- contextual object of expression call- Returns:
- expression evaluation result
-
isExpressionGlobal
Determines if the supplied expression is "global", i.e. if it needs contextual object to be evaluated. If expression does not need contextual object, then this expression is considered to be "global" or "static"- Parameters:
expression
- expression to be inspected- Returns:
- true if expression does not need the contextual object
-
getExpressionCachingKey
Calculates a string identifier of the expression. Expression evaluation results of objects are cached under this key return null if result should not be cached.- Parameters:
expression
- expression, results of which are to be cached- Returns:
- identifier of the expression
-