Package org.neo4j.cypherdsl.core.support
Class ReflectiveVisitor
- java.lang.Object
-
- org.neo4j.cypherdsl.core.support.ReflectiveVisitor
-
- All Implemented Interfaces:
Visitor
public abstract class ReflectiveVisitor extends java.lang.Object implements Visitor
This is a convenience class implementing aVisitorand it takes care of choosing the right methods to dispatch theVisitor.enter(Visitable)andVisitor.leave(Visitable)calls to.Classes extending this visitor need to provide corresponding
enterandleavemethods taking exactly one argument of the type ofVisitablethey are interested it.The type must be an exact match, this support class doesn't try to find a close match up in the class hierarchy if it doesn't find an exact match.
- Since:
- 1.0
- Author:
- Michael J. Simons, Gerrit Meier
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<AliasedExpression>visitableToAliasedA set of aliased expressions that already have been seen and for which an alias must be used on each following appearance.
-
Constructor Summary
Constructors Constructor Description ReflectiveVisitor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidenter(Visitable visitable)Enter aVisitable.voidleave(Visitable visitable)Leave aVisitable.protected abstract voidpostLeave(Visitable visitable)This is a hook that is called with the uncasted, raw visitable just after leaving the visitable.protected abstract booleanpreEnter(Visitable visitable)This is a hook that is called with the uncasted, raw visitable just before entering a visitable.
-
-
-
Field Detail
-
visitableToAliased
protected final java.util.Set<AliasedExpression> visitableToAliased
A set of aliased expressions that already have been seen and for which an alias must be used on each following appearance.
-
-
Method Detail
-
preEnter
protected abstract boolean preEnter(Visitable visitable)
This is a hook that is called with the uncasted, raw visitable just before entering a visitable.The hook is called regardless wither a matching
enteris found or not.- Parameters:
visitable- The visitable that is passed on to a matching enter after this call.- Returns:
- true, when visiting of elements should be stopped until this element is left again.
-
postLeave
protected abstract void postLeave(Visitable visitable)
This is a hook that is called with the uncasted, raw visitable just after leaving the visitable.The hook is called regardless wither a matching
leaveis found or not.- Parameters:
visitable- The visitable that is passed on to a matching leave after this call.
-
enter
public final void enter(Visitable visitable)
Description copied from interface:VisitorEnter aVisitable.
-
-