Class ChildExpressionBuilder<P extends Builder<?>>
Object
ExpressionBuilder
ChildExpressionBuilder<P>
- Type Parameters:
P
- parent builder
- All Implemented Interfaces:
Builder<Expression>
- Direct Known Subclasses:
FunctionBuilder.ParamBuilder
Child expression builder; suitable for use collecting function parameters and binary expression arguments.
This builder is designed to be "chained" from a parent builder; you may return to the parent builder at any time by calling end().
-
Field Summary
FieldsFields inherited from class ExpressionBuilder
delegate, ff, unset
-
Constructor Summary
ConstructorsConstructorDescriptionChildExpressionBuilder
(P parent) ChildExpressionBuilder
(P parent, Expression expr1) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the parameter; adding it to the parent.end()
Build the expression and return to the parent builder.Inline literal value.Inline property name value.reset()
Configure the Builder to produce a default result.reset
(Expression original) Configure the Builder to produce a copy of the provided original.unset()
Configure the Builder to producenull
.
-
Field Details
-
parent
-
-
Constructor Details
-
ChildExpressionBuilder
-
ChildExpressionBuilder
-
-
Method Details
-
reset
Description copied from interface:Builder
Configure the Builder to produce a default result. -
reset
Description copied from interface:Builder
Configure the Builder to produce a copy of the provided original. -
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. -
build
Build the parameter; adding it to the parent.When using this from another builder you may wish to override the this build() method as shown below:
final Expression array[] = ... ChildExpressionBuilder first = new ChildExpressionBuilder<?>(this) { public Expression build() { array[0] = super.build(); return array[0]; } }; }
-
end
Build the expression and return to the parent builder.Example use:
b.add().expr1().literal(1).end().expr2().literal(2).end().build();
- See Also:
-
_build()
-
literal
Inline literal value.Example:
b.literal( 1 );
- Overrides:
literal
in classExpressionBuilder
- Parameters:
obj
- Object to use as the resulting literal
-
property
Inline property name value.Example:
b.property("x");
- Overrides:
property
in classExpressionBuilder
-