Class ExpressionHelper
java.lang.Object
com.nomagic.magicdraw.expressions.ExpressionHelper
Various utility methods used for
ParameterizedExpression
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
call
(ParameterizedExpression expression, Object... arguments) SimplifiedParametrizedExpression call.static Object
call
(ParameterizedExpression parameterizedExpression, List<?> arguments, ValueContext valueContext) CallparameterizedExpression
and returns value.static ParameterizedExpression
getBehaviorExpression
(Behavior behavior) Gets expression represented by a given behavior.
-
Constructor Details
-
ExpressionHelper
public ExpressionHelper()
-
-
Method Details
-
call
@CheckForNull public static Object call(ParameterizedExpression expression, Object... arguments) throws Exception SimplifiedParametrizedExpression call. Intended for easier usage from scripts.ValueContext
isnull
.- Parameters:
expression
- expression to call. If not ParametrizedExpression result will be nullarguments
- arguments for the expression- Returns:
- expression result
- Throws:
Exception
- various exceptions, mostly from java.lang.reflect.Method#invoke(java.lang.Object, java.lang.Object...)
-
call
@CheckForNull public static Object call(ParameterizedExpression parameterizedExpression, @CheckForNull List<?> arguments, @CheckForNull ValueContext valueContext) throws Exception CallparameterizedExpression
and returns value.- Parameters:
parameterizedExpression
- expression which should be calledarguments
- arguments for the expression. If arguments do ot match, then exception will be thrownvalueContext
- value context for the evaluated value. Usuallynull
- Returns:
- value of the expression call
- Throws:
Exception
- various exceptions, mostly from java.lang.reflect.Method#invoke(java.lang.Object, java.lang.Object...)
-
getBehaviorExpression
Gets expression represented by a given behavior.- Parameters:
behavior
- behavior which represents an expression.- Returns:
- parameterized expression.
-