P - parent builderpublic class ChildExpressionBuilder<P extends Builder<?>> extends ExpressionBuilder
This builder is designed to be "chained" from a parent builder; you may return to the parent builder at any time by calling end().
| Modifier and Type | Field and Description |
|---|---|
protected P |
parent |
delegate, ff, unset| Constructor and Description |
|---|
ChildExpressionBuilder(P parent) |
ChildExpressionBuilder(P parent,
Expression expr1) |
| Modifier and Type | Method and Description |
|---|---|
Expression |
build()
Build the parameter; adding it to the parent.
|
P |
end()
Build the expression and return to the parent builder.
|
P |
literal(Object obj)
Inline literal value.
|
P |
property(String xpath)
Inline property name value.
|
ChildExpressionBuilder<P> |
reset()
Configure the Builder to produce a default result.
|
ChildExpressionBuilder<P> |
reset(Expression original)
Configure the Builder to produce a copy of the provided original.
|
ChildExpressionBuilder<P> |
unset()
Configure the Builder to produce
null. |
public ChildExpressionBuilder(P parent)
public ChildExpressionBuilder(P parent, Expression expr1)
public ChildExpressionBuilder<P> reset()
Builderreset in interface Builder<Expression>reset in class ExpressionBuilderpublic ChildExpressionBuilder<P> reset(Expression original)
Builderreset in interface Builder<Expression>reset in class ExpressionBuilderoriginal - Original, if null this will behave the same as unset()public ChildExpressionBuilder<P> unset()
Buildernull.
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.
unset in interface Builder<Expression>unset in class ExpressionBuildernullpublic Expression build()
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];
}
};
}
build in interface Builder<Expression>build in class ExpressionBuilderpublic P end()
Example use:b.add().expr1().literal(1).end().expr2().literal(2).end().build();
_build()public P literal(Object obj)
Example:b.literal( 1 );
literal in class ExpressionBuilderobj - Object to use as the resulting literalpublic P property(String xpath)
Example:b.property("x");
property in class ExpressionBuilderCopyright © 1996–2021 Geotools. All rights reserved.