Class LiteralExpressions

java.lang.Object
com.dassault_systemes.modeler.kerml.model.LiteralExpressions

@OpenApiAll public class LiteralExpressions extends Object
Utility class to work with single LiteralExpression or multiple ones aggregated with comma OperatorExpression
  • Constructor Details

    • LiteralExpressions

      public LiteralExpressions()
  • Method Details

    • createExpression

      @CheckForNull public static Expression createExpression(@CheckForNull Object value, Element context)
      Creates expression representing given value. Supports Integer, String, Boolean, Double or List of those.
      Parameters:
      value - value - either literal or a List of literals
      context - context of expression
      Returns:
      created expression
    • setValue

      @CheckForNull public static Expression setValue(@CheckForNull Expression expression, @CheckForNull Object value, Element context)
      Set a value for given Expression or create new Expression if value does not match a given one.
      Parameters:
      expression - expression to set value for
      value - value
      context - context of new created Expression
      Returns:
      given expression or a new one
    • getValue

      @CheckForNull public static Object getValue(LiteralExpression expression)
      Returns a value of given LiteralExpression. Returns null for unsupported expression like LiteralInfinity.
      Parameters:
      expression - expression
      Returns:
      value