X.BinaryOp
, X.UnaryOp
, X.Val
, X.Var
public abstract class X
extends java.lang.Object
X
is used in
component repositories to formulate component queries but may be used anywhere where
simple boolean expressions are useful.
A built-in evaluation of an expression over a map defining a context is supported.
For example, given a map m={"a":5, "b":"hello"}
,
var("a").ge(val(6)).and(var("b").eq(val("hello"))).eval(m)would evaluate to
false
while
var("a").le(val(6)).and(var("b").eq(val("hello"))).eval(m)would evaluate to
true
.Modifier and Type | Class | Description |
---|---|---|
static class |
X.And |
"AND" logical operator
|
static class |
X.BinaryOp |
Abstract binary operators
|
static class |
X.Eq |
"equality" comparison operator.
|
static class |
X.Ge |
"greater or equal" comparison operator.
|
static class |
X.Gt |
"greater than" comparison operator.
|
static class |
X.In |
"containment" operator.
|
static class |
X.Le |
"less or equal" comparison operator.
|
static class |
X.Lt |
"less than" comparison operator.
|
static class |
X.Neq |
"not equals" comparison operator.
|
static class |
X.Not |
Negation logical operator
|
static class |
X.Or |
"OR" logical operator
|
static class |
X.UnaryOp |
Abstract single-operand operator
|
static class |
X.Val |
Explicit value.
|
static class |
X.Var |
Variable of field value operator.
|
static class |
X.Xor |
"XOR" logical operator
|
Constructor | Description |
---|---|
X() |
Modifier and Type | Method | Description |
---|---|---|
X |
and(X x) |
Convenience method for chain-style notation
of expressions.
|
static X |
and(X x,
X y) |
Static factory method, for convenience
|
X |
eq(X x) |
Convenience method for chain-style notation
of expressions.
|
static X |
eq(X x,
X y) |
Static factory method, for convenience
|
java.lang.Object |
eval() |
|
abstract java.lang.Object |
eval(java.util.Map<java.lang.String,java.lang.Object> context) |
Evaluation of the expression over a map style context that
defines variable values.
|
java.lang.Object |
eval(java.util.Properties context) |
Convenience version of
eval(Map) accepting a Properties argument |
X |
ge(X x) |
Convenience method for chain-style notation
of expressions.
|
X |
gt(X x) |
Convenience method for chain-style notation
of expressions.
|
X |
in(X x) |
Convenience method for chain-style notation
of expressions.
|
X |
le(X x) |
Convenience method for chain-style notation
of expressions.
|
X |
lt(X x) |
Convenience method for chain-style notation
of expressions.
|
X |
neq(X x) |
Convenience method for chain-style notation
of expressions.
|
static X |
neq(X x,
X y) |
Static factory method, for convenience
|
X |
not() |
Convenience method for chain-style notation
of expressions.
|
static X |
not(X x) |
Static factory method, for convenience
|
X |
or(X x) |
Convenience method for chain-style notation
of expressions.
|
static X |
or(X x,
X y) |
Static factory method, for convenience
|
static X |
val(java.lang.Object val) |
Static factory method, for convenience
|
static X |
var(java.lang.String name) |
Static factory method, for convenience
|
X |
xor(X x) |
Convenience method for chain-style notation
of expressions.
|
static X |
xor(X x,
X y) |
Static factory method, for convenience
|
public X not()
public static X val(java.lang.Object val)
public static X var(java.lang.String name)
public abstract java.lang.Object eval(java.util.Map<java.lang.String,java.lang.Object> context)
public java.lang.Object eval(java.util.Properties context)
eval(Map)
accepting a Properties
argumentpublic java.lang.Object eval()