Class ExpressionFactory

java.lang.Object
com.luciad.expressions.ExpressionFactory

public final class ExpressionFactory extends Object
Class containing static factory methods to create different types of expressions and conditions.
  • Method Details Link icon

    • literal Link icon

      @NotNull public static Expression literal(@NotNull ExpressionValue value)
      Creates a literal for the ExpressionValue value.
      Parameters:
      value - The expression value.
      Returns:
      the literal expression.
    • valueReference Link icon

      @NotNull public static Expression valueReference(@NotNull String propertyPath)
      Creates a value reference (property name) based on a simple xpath expression.

      Nested properties can be referenced by using the '/' as separator.

      Parameters:
      propertyPath - Path for the property whose value needs to be retrieved.
      Returns:
      the value reference expression.
    • orOp Link icon

      @NotNull public static Expression orOp(@NotNull List<@NotNull Expression> conditions) throws IllegalStateException
      Creates a new or condition that evaluates to true if one of the conditions in conditions is true.
      Parameters:
      conditions - Two or more conditions.
      Returns:
      the or operator.
      Throws:
      IllegalStateException - when there are less than 2 conditions.
    • andOp Link icon

      @NotNull public static Expression andOp(@NotNull List<@NotNull Expression> conditions) throws IllegalStateException
      Creates a new and condition that evaluates to true if all of the conditions in conditions are true.
      Parameters:
      conditions - Two or more conditions.
      Returns:
      the and operator.
      Throws:
      IllegalStateException - when there are less than 2 conditions.
    • notOp Link icon

      @NotNull public static Expression notOp(@NotNull Expression condition)
      Creates a condition that evaluates to true when the given condition is false and vice versa.
      Parameters:
      condition - Condition to invert.
      Returns:
      the condition that is the inverse of the given condition
    • equal Link icon

      @NotNull public static Expression equal(@NotNull Expression left, @NotNull Expression right)
      Creates a condition that evaluates to true when left is equal to right.
      Parameters:
      left - Left expression.
      right - Right expression.
      Returns:
      the equals operator.
    • notEqual Link icon

      @NotNull public static Expression notEqual(@NotNull Expression left, @NotNull Expression right)
      Creates a condition that evaluates to true when left is not equal to right.
      Parameters:
      left - Left expression.
      right - Right expression.
      Returns:
      the not equals operator.
    • gt Link icon

      @NotNull public static Expression gt(@NotNull Expression left, @NotNull Expression right)
      Creates a condition that evaluates to true when left is greater than right.
      Parameters:
      left - Left expression.
      right - Right expression.
      Returns:
      the greater than operator.
    • gte Link icon

      @NotNull public static Expression gte(@NotNull Expression left, @NotNull Expression right)
      Creates a condition that evaluates to true when left is greater than or equal to right.
      Parameters:
      left - Left expression.
      right - Right expression.
      Returns:
      the greater than or equal to operator.
    • lt Link icon

      @NotNull public static Expression lt(@NotNull Expression left, @NotNull Expression right)
      Creates a condition that evaluates to true when left is less than right.
      Parameters:
      left - Left expression.
      right - Right expression.
      Returns:
      the less than operator.
    • lte Link icon

      @NotNull public static Expression lte(@NotNull Expression left, @NotNull Expression right)
      Creates a condition that evaluates to true when left is less than or equal to right.
      Parameters:
      left - Left expression.
      right - Right expression.
      Returns:
      the less than or equal to operator.
    • bbox Link icon

      @NotNull public static Expression bbox(@NotNull Expression left, @NotNull Expression right)
      Creates a condition that evaluates to true when left interacts with right bounding box.
      Parameters:
      left - Left expression.
      right - Right expression.
      Returns:
      the bounding box operator expression.
    • bbox Link icon

      @NotNull public static Expression bbox(@NotNull Expression expression)
      Creates a condition that evaluates to true when the given expression interacts with the feature geometry.
      Parameters:
      expression - must be a Geometry Expression containing a Bounds.
      Returns:
      the bounding box operator expression.
    • like Link icon

      @NotNull public static Expression like(@NotNull String propertyPath, @NotNull String pattern, boolean matchCase)
      Creates a like expression using a value reference (property name) based on a simple xpath expression and a pattern.

      Nested properties can be referenced by using the '/' as separator.

      The pattern uses default values for a wildcard ('*'), a single char ('?') and the escape character ('\').

      Parameters:
      propertyPath - Path for the property whose value needs to be retrieved.
      pattern - The pattern to match.
      matchCase - Whether to match case sensitive or case insensitive.
      Returns:
      the like expression.
      Since:
      2023.1
    • like Link icon

      @NotNull public static Expression like(@NotNull String propertyPath, @NotNull String pattern, boolean matchCase, char wildCard, char singleChar, char escapeChar)
      Creates a like expression using a value reference (property name) based on a simple xpath expression and a pattern.

      Nested properties can be referenced by using the '/' as separator.

      Parameters:
      propertyPath - Path for the property whose value needs to be retrieved.
      pattern - The pattern to match.
      matchCase - Whether to match case sensitive or case insensitive.
      wildCard - The character used as wild card to match zero or more characters.
      singleChar - The character used as single character to match exactly one character.
      escapeChar - The character used to escape the meaning of the wildCard, singleChar and escapeChar itself.
      Returns:
      the like expression.
      Since:
      2023.1