T
- the type of planner expression that is contained in this reference@API(value=EXPERIMENTAL) public interface ExpressionRef<T extends PlannerExpression> extends Bindable
MutableExpressionRef
, it does not provide an insert()
method,
so the rule would need to cast the reference back to MutableExpressionRef
before modifying it.Modifier and Type | Interface and Description |
---|---|
static class |
ExpressionRef.UngettableReferenceException
An exception thrown when
get() is called on a reference that does not support it, such as a group reference. |
Modifier and Type | Method and Description |
---|---|
<U> U |
acceptPropertyVisitor(PlannerProperty<U> property) |
default Stream<PlannerBindings> |
bindTo(ExpressionMatcher<? extends Bindable> matcher)
Try to bind the given matcher to this reference.
|
Stream<PlannerBindings> |
bindWithin(ExpressionMatcher<? extends Bindable> matcher)
Try to bind the given matcher to the members of this reference.
|
boolean |
containsAllInMemo(ExpressionRef<? extends PlannerExpression> otherRef) |
<U extends PlannerExpression> |
flatMapNullable(Function<T,ExpressionRef<U>> nullableFunc) |
T |
get()
Return the expression contained in this reference.
|
PlannerExpressionPointerSet<T> |
getMembers() |
ExpressionRef<T> |
getNewRefWith(T expression) |
<U extends PlannerExpression> |
map(Function<T,U> func) |
@Nonnull T get()
ExpressionRef.UngettableReferenceException
- if the reference does not support retrieving its expression<U> U acceptPropertyVisitor(@Nonnull PlannerProperty<U> property)
@Nonnull default Stream<PlannerBindings> bindTo(@Nonnull ExpressionMatcher<? extends Bindable> matcher)
PlannerExpression
rather than an ExpressionRef
, it will
call bindWithin(ExpressionMatcher)
instead.
Binding to references can be a bit subtle: some matchers (such as ReferenceMatcher
) can bind to references
directly while others (such as TypeMatcher
) can't, since they need access to the underlying operator
which might not even be well defined. This method implements binding to the reference, rather than to
its member(s).
@Nonnull Stream<PlannerBindings> bindWithin(@Nonnull ExpressionMatcher<? extends Bindable> matcher)
Stream
API, so as to minimize unnecessary
work.matcher
- an expression matcher to match the member(s) of this reference with@Nonnull <U extends PlannerExpression> ExpressionRef<U> map(@Nonnull Function<T,U> func)
@Nullable <U extends PlannerExpression> ExpressionRef<U> flatMapNullable(@Nonnull Function<T,ExpressionRef<U>> nullableFunc)
@Nonnull ExpressionRef<T> getNewRefWith(@Nonnull T expression)
boolean containsAllInMemo(@Nonnull ExpressionRef<? extends PlannerExpression> otherRef)
PlannerExpressionPointerSet<T> getMembers()