Package com.luciad.expressions
Class ExpressionFactory
java.lang.Object
com.luciad.expressions.ExpressionFactory
Class containing static factory methods to create different types of expressions and conditions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressionandOp(List<@NotNull Expression> conditions) Creates a newandcondition that evaluates to true if all of the conditions inconditionsare true.static Expressionbbox(Expression expression) Creates a condition that evaluates to true when the given expression interacts with the feature geometry.static Expressionbbox(Expression left, Expression right) Creates a condition that evaluates to true whenleftinteracts withrightbounding box.static Expressionequal(Expression left, Expression right) Creates a condition that evaluates to true whenleftis equal toright.static Expressiongt(Expression left, Expression right) Creates a condition that evaluates to true whenleftis greater thanright.static Expressiongte(Expression left, Expression right) Creates a condition that evaluates to true whenleftis greater than or equal toright.static ExpressionCreates a like expression using a value reference (property name) based on a simple xpath expression and a pattern.static Expressionlike(String propertyPath, 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.static Expressionliteral(ExpressionValue value) Creates a literal for theExpressionValuevalue.static Expressionlt(Expression left, Expression right) Creates a condition that evaluates to true whenleftis less thanright.static Expressionlte(Expression left, Expression right) Creates a condition that evaluates to true whenleftis less than or equal toright.static ExpressionnotEqual(Expression left, Expression right) Creates a condition that evaluates to true whenleftis not equal toright.static ExpressionnotOp(Expression condition) Creates a condition that evaluates to true when the given condition is false and vice versa.static ExpressionorOp(List<@NotNull Expression> conditions) Creates a neworcondition that evaluates to true if one of the conditions inconditionsis true.static ExpressionvalueReference(String propertyPath) Creates a value reference (property name) based on a simple xpath expression.
-
Method Details
-
literal
Creates a literal for theExpressionValuevalue.- Parameters:
value- The expression value.- Returns:
- the literal expression.
-
valueReference
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
@NotNull public static Expression orOp(@NotNull List<@NotNull Expression> conditions) throws IllegalStateException Creates a neworcondition that evaluates to true if one of the conditions inconditionsis true.- Parameters:
conditions- Two or more conditions.- Returns:
- the
oroperator. - Throws:
IllegalStateException- when there are less than 2 conditions.
-
andOp
@NotNull public static Expression andOp(@NotNull List<@NotNull Expression> conditions) throws IllegalStateException Creates a newandcondition that evaluates to true if all of the conditions inconditionsare true.- Parameters:
conditions- Two or more conditions.- Returns:
- the
andoperator. - Throws:
IllegalStateException- when there are less than 2 conditions.
-
notOp
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
Creates a condition that evaluates to true whenleftis equal toright.- Parameters:
left- Left expression.right- Right expression.- Returns:
- the
equalsoperator.
-
notEqual
Creates a condition that evaluates to true whenleftis not equal toright.- Parameters:
left- Left expression.right- Right expression.- Returns:
- the
not equalsoperator.
-
gt
Creates a condition that evaluates to true whenleftis greater thanright.- Parameters:
left- Left expression.right- Right expression.- Returns:
- the
greater thanoperator.
-
gte
Creates a condition that evaluates to true whenleftis greater than or equal toright.- Parameters:
left- Left expression.right- Right expression.- Returns:
- the
greater than or equal tooperator.
-
lt
Creates a condition that evaluates to true whenleftis less thanright.- Parameters:
left- Left expression.right- Right expression.- Returns:
- the
less thanoperator.
-
lte
Creates a condition that evaluates to true whenleftis less than or equal toright.- Parameters:
left- Left expression.right- Right expression.- Returns:
- the
less than or equal tooperator.
-
bbox
Creates a condition that evaluates to true whenleftinteracts withrightbounding box.- Parameters:
left- Left expression.right- Right expression.- Returns:
- the bounding box operator expression.
-
bbox
Creates a condition that evaluates to true when the given expression interacts with the feature geometry.- Parameters:
expression- must be aGeometryExpressioncontaining aBounds.- Returns:
- the bounding box operator expression.
-
like
@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
@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 thewildCard,singleCharandescapeCharitself.- Returns:
- the like expression.
- Since:
- 2023.1
-