public final class ExpressionFactory extends Object
Modifier and Type | Method and Description |
---|---|
static Expression |
andOp(List<Expression> conditions)
Creates a new
and condition that evaluates to true if all of the conditions in conditions 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 when
left interacts with right bounding box. |
static Expression |
equal(Expression left,
Expression right)
Creates a condition that evaluates to true when
left is equal to right . |
static Expression |
gt(Expression left,
Expression right)
Creates a condition that evaluates to true when
left is greater than right . |
static Expression |
gte(Expression left,
Expression right)
Creates a condition that evaluates to true when
left is greater than or equal to right . |
static Expression |
like(String propertyPath,
String pattern,
boolean matchCase)
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 the
ExpressionValue value. |
static Expression |
lt(Expression left,
Expression right)
Creates a condition that evaluates to true when
left is less than right . |
static Expression |
lte(Expression left,
Expression right)
Creates a condition that evaluates to true when
left is less than or equal to right . |
static Expression |
notEqual(Expression left,
Expression right)
Creates a condition that evaluates to true when
left is not equal to right . |
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<Expression> conditions)
Creates a new
or condition that evaluates to true if one of the conditions in conditions is true. |
static Expression |
valueReference(String propertyPath)
Creates a value reference (property name) based on a simple xpath expression.
|
@NotNull public static Expression literal(@NotNull ExpressionValue value)
ExpressionValue
value.value
- The expression value.@NotNull public static Expression valueReference(@NotNull String propertyPath)
Nested properties can be referenced by using the '/' as separator.
propertyPath
- Path for the property whose value needs to be retrieved.@NotNull public static Expression orOp(@NotNull List<Expression> conditions) throws IllegalStateException
or
condition that evaluates to true if one of the conditions in conditions
is true.conditions
- Two or more conditions.or
operator.IllegalStateException
- when there are less than 2 conditions.@NotNull public static Expression andOp(@NotNull List<Expression> conditions) throws IllegalStateException
and
condition that evaluates to true if all of the conditions in conditions
are true.conditions
- Two or more conditions.and
operator.IllegalStateException
- when there are less than 2 conditions.@NotNull public static Expression notOp(@NotNull Expression condition)
condition
- Condition to invert.@NotNull public static Expression equal(@NotNull Expression left, @NotNull Expression right)
left
is equal to right
.left
- Left expression.right
- Right expression.equals
operator.@NotNull public static Expression notEqual(@NotNull Expression left, @NotNull Expression right)
left
is not equal to right
.left
- Left expression.right
- Right expression.not equals
operator.@NotNull public static Expression gt(@NotNull Expression left, @NotNull Expression right)
left
is greater than right
.left
- Left expression.right
- Right expression.greater than
operator.@NotNull public static Expression gte(@NotNull Expression left, @NotNull Expression right)
left
is greater than or equal to right
.left
- Left expression.right
- Right expression.greater than or equal to
operator.@NotNull public static Expression lt(@NotNull Expression left, @NotNull Expression right)
left
is less than right
.left
- Left expression.right
- Right expression.less than
operator.@NotNull public static Expression lte(@NotNull Expression left, @NotNull Expression right)
left
is less than or equal to right
.left
- Left expression.right
- Right expression.less than or equal to
operator.@NotNull public static Expression bbox(@NotNull Expression left, @NotNull Expression right)
left
interacts with right
bounding box.left
- Left expression.right
- Right expression.@NotNull public static Expression bbox(@NotNull Expression expression)
expression
- must be a Geometry
Expression
containing a Bounds
.@NotNull public static Expression like(@NotNull String propertyPath, @NotNull String pattern, boolean matchCase)
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 ('\').
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.@NotNull public static Expression like(@NotNull String propertyPath, @NotNull String pattern, boolean matchCase, char wildCard, char singleChar, char escapeChar)
Nested properties can be referenced by using the '/' as separator.
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.