Class LiteralExpressions
java.lang.Object
com.dassault_systemes.modeler.kerml.model.LiteralExpressions
Utility class to work with single
LiteralExpression or multiple ones aggregated with comma OperatorExpression-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressioncreateExpression(Object value, Element context) Creates expression representing given value.static ObjectgetValue(LiteralExpression expression) Returns a value of givenLiteralExpression.static ExpressionsetValue(Expression expression, Object value, Element context) Set a value for givenExpressionor create newExpressionif value does not match a given one.
-
Constructor Details
-
LiteralExpressions
public LiteralExpressions()
-
-
Method Details
-
createExpression
@CheckForNull public static Expression createExpression(@CheckForNull Object value, Element context) Creates expression representing given value. SupportsInteger,String,Boolean,DoubleorListof those.- Parameters:
value- value - either literal or aListof literalscontext- context of expression- Returns:
- created expression
-
setValue
@CheckForNull public static Expression setValue(@CheckForNull Expression expression, @CheckForNull Object value, Element context) Set a value for givenExpressionor create newExpressionif value does not match a given one.- Parameters:
expression- expression to set value forvalue- valuecontext- context of new createdExpression- Returns:
- given expression or a new one
-
getValue
Returns a value of givenLiteralExpression. Returns null for unsupported expression likeLiteralInfinity.- Parameters:
expression- expression- Returns:
- value
-