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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.Object
evaluate(OpaqueExpression expression, Element object)
Entry method for expression evaluation.default java.lang.Object
evaluate(OpaqueExpression expression, Element object, java.util.List<NamedArgument> arguments)
Entry method for expression evaluation.java.lang.String
getExpressionCachingKey(OpaqueExpression expression)
Calculates a string identifier of the expression.boolean
isExpressionGlobal(OpaqueExpression expression)
Determines if the supplied expression is "global", i.e.
-
-
-
Method Detail
-
evaluate
@OpenApi java.lang.Object evaluate(OpaqueExpression expression, @CheckForNull Element object)
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 java.lang.Object evaluate(OpaqueExpression expression, @CheckForNull Element object, java.util.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
@OpenApi boolean isExpressionGlobal(OpaqueExpression expression)
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
@OpenApi java.lang.String getExpressionCachingKey(OpaqueExpression expression)
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
-
-