Class ExpressionBuilder
- Object
-
- ExpressionBuilder
-
- All Implemented Interfaces:
Builder<Expression>
- Direct Known Subclasses:
ChildExpressionBuilder
public class ExpressionBuilder extends Object implements Builder<Expression>
ExpressionBuilder acting as a simple wrapper around an Expression.
-
-
Field Summary
Fields Modifier and Type Field Description protected Builder<? extends Expression>
delegate
protected FilterFactory
ff
protected boolean
unset
-
Constructor Summary
Constructors Constructor Description ExpressionBuilder()
ExpressionBuilder(Expression expr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddBuilder
add()
Expression
build()
Build the expression.DivideBuilder
divide()
FunctionBuilder
function()
FunctionBuilder
function(String name)
boolean
isUnset()
LiteralBuilder
literal()
Define expression as a literal.Builder<?>
literal(Object literal)
MultiplyBuilder
multiply()
PropertyNameBuilder
property()
Builder<?>
property(String xpath)
ExpressionBuilder
reset()
Configure the Builder to produce a default result.ExpressionBuilder
reset(Expression original)
Configure the Builder to produce a copy of the provided original.SubtractBuilder
subtract()
ExpressionBuilder
unset()
Configure the Builder to producenull
.
-
-
-
Field Detail
-
ff
protected FilterFactory ff
-
unset
protected boolean unset
-
delegate
protected Builder<? extends Expression> delegate
-
-
Constructor Detail
-
ExpressionBuilder
public ExpressionBuilder()
-
ExpressionBuilder
public ExpressionBuilder(Expression expr)
-
-
Method Detail
-
literal
public LiteralBuilder literal()
Define expression as a literal.Example:
b.literal().value( 1 );
-
add
public AddBuilder add()
-
multiply
public MultiplyBuilder multiply()
-
divide
public DivideBuilder divide()
-
subtract
public SubtractBuilder subtract()
-
property
public PropertyNameBuilder property()
-
function
public FunctionBuilder function()
-
function
public FunctionBuilder function(String name)
-
build
public Expression build()
Build the expression.- Specified by:
build
in interfaceBuilder<Expression>
- Returns:
- Created object may be null if unset()
-
reset
public ExpressionBuilder reset()
Description copied from interface:Builder
Configure the Builder to produce a default result.- Specified by:
reset
in interfaceBuilder<Expression>
- Returns:
- Builder configured to produce a default result.
-
reset
public ExpressionBuilder reset(Expression original)
Description copied from interface:Builder
Configure the Builder to produce a copy of the provided original.- Specified by:
reset
in interfaceBuilder<Expression>
- Parameters:
original
- Original, if null this will behave the same as unset()- Returns:
- Builder configured to produce the provided original
-
unset
public ExpressionBuilder unset()
Description copied from interface:Builder
Configure the Builder to producenull
.This method allows a Builder to be used as a placeholder; in its unset state the build() method will produce
null
. If any of the builder methods are used the builder will produce a result.- Specified by:
unset
in interfaceBuilder<Expression>
- Returns:
- Builder configured to build
null
-
isUnset
public boolean isUnset()
-
-