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 Expression
andOp
(List<@NotNull Expression> conditions) Creates a newand
condition that evaluates to true if all of the conditions inconditions
are true.static Expression
bbox
(Expression expression) Creates a condition that evaluates to true when the given expression interacts with the feature geometry.static Expression
bbox
(Expression left, Expression right) Creates a condition that evaluates to true whenleft
interacts withright
bounding box.static Expression
equal
(Expression left, Expression right) Creates a condition that evaluates to true whenleft
is equal toright
.static Expression
gt
(Expression left, Expression right) Creates a condition that evaluates to true whenleft
is greater thanright
.static Expression
gte
(Expression left, Expression right) Creates a condition that evaluates to true whenleft
is greater than or equal toright
.static Expression
Creates a like expression using a value reference (property name) based on a simple xpath expression and a pattern.static Expression
like
(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 Expression
literal
(ExpressionValue value) Creates a literal for theExpressionValue
value.static Expression
lt
(Expression left, Expression right) Creates a condition that evaluates to true whenleft
is less thanright
.static Expression
lte
(Expression left, Expression right) Creates a condition that evaluates to true whenleft
is less than or equal toright
.static Expression
notEqual
(Expression left, Expression right) Creates a condition that evaluates to true whenleft
is not equal toright
.static Expression
notOp
(Expression condition) Creates a condition that evaluates to true when the given condition is false and vice versa.static Expression
orOp
(List<@NotNull Expression> conditions) Creates a newor
condition that evaluates to true if one of the conditions inconditions
is true.static Expression
valueReference
(String propertyPath) Creates a value reference (property name) based on a simple xpath expression.
-
Method Details
-
literal
Creates a literal for theExpressionValue
value.- 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 newor
condition that evaluates to true if one of the conditions inconditions
is true.- Parameters:
conditions
- Two or more conditions.- Returns:
- the
or
operator. - Throws:
IllegalStateException
- when there are less than 2 conditions.
-
andOp
@NotNull public static Expression andOp(@NotNull List<@NotNull Expression> conditions) throws IllegalStateException Creates a newand
condition that evaluates to true if all of the conditions inconditions
are true.- Parameters:
conditions
- Two or more conditions.- Returns:
- the
and
operator. - 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 whenleft
is equal toright
.- Parameters:
left
- Left expression.right
- Right expression.- Returns:
- the
equals
operator.
-
notEqual
Creates a condition that evaluates to true whenleft
is not equal toright
.- Parameters:
left
- Left expression.right
- Right expression.- Returns:
- the
not equals
operator.
-
gt
Creates a condition that evaluates to true whenleft
is greater thanright
.- Parameters:
left
- Left expression.right
- Right expression.- Returns:
- the
greater than
operator.
-
gte
Creates a condition that evaluates to true whenleft
is greater than or equal toright
.- Parameters:
left
- Left expression.right
- Right expression.- Returns:
- the
greater than or equal to
operator.
-
lt
Creates a condition that evaluates to true whenleft
is less thanright
.- Parameters:
left
- Left expression.right
- Right expression.- Returns:
- the
less than
operator.
-
lte
Creates a condition that evaluates to true whenleft
is less than or equal toright
.- Parameters:
left
- Left expression.right
- Right expression.- Returns:
- the
less than or equal to
operator.
-
bbox
Creates a condition that evaluates to true whenleft
interacts withright
bounding 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 aGeometry
Expression
containing 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
,singleChar
andescapeChar
itself.- Returns:
- the like expression.
- Since:
- 2023.1
-