public class Visitors extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Visitors.AbstractVisitor
A common base class for all visitors, which provides no-op implementations for all
visit(...) methods. |
static class |
Visitors.JcrSql2Writer |
static class |
Visitors.NavigationVisitor
An abstract visitor implementation that performs navigation of the query object.
|
static class |
Visitors.ReadableVisitor |
static class |
Visitors.WalkAllVisitor
A visitor implementation that walks the entire query object tree and delegates to another supplied visitor to do the actual
work.
|
| Modifier and Type | Field and Description |
|---|---|
protected static char |
CLOSE_SQUARE |
protected static char |
DOUBLE_QUOTE |
protected static char |
OPEN_SQUARE |
protected static char |
SINGLE_QUOTE |
| Constructor and Description |
|---|
Visitors() |
| Modifier and Type | Method and Description |
|---|---|
static Map<SelectorName,SelectorName> |
getSelectorAliasesByName(Visitable visitable)
Get a map of the selector aliases keyed by their names.
|
static Map<SelectorName,SelectorName> |
getSelectorNamesByAlias(Visitable visitable)
Get a map of the selector names keyed by their aliases.
|
static Set<SelectorName> |
getSelectorsReferencedBy(Visitable visitable)
Get the names of the selectors referenced by the visitable object.
|
static String |
readable(Object[] tuple) |
static String |
readable(Object[] tuple,
ExecutionContext context) |
static String |
readable(Visitable visitable)
Using a visitor, obtain the readable string representation of the supplied
object |
static String |
readable(Visitable visitable,
ExecutionContext context)
Using a visitor, obtain the readable string representation of the supplied
object |
static Collection<Subquery> |
subqueries(Visitable visitable,
boolean includeNestedSubqueries)
|
static <GeneralVisitor extends Visitor> |
visit(Visitable visitable,
GeneralVisitor visitor)
|
static <StrategyVisitor extends Visitor> |
visitAll(Visitable visitable,
StrategyVisitor strategyVisitor)
Visit all objects in the supplied
object using a Visitors.NavigationVisitor (specifically a
Visitors.WalkAllVisitor), and with each of these visited objects calling the appropriate visit(...) method on the
supplied Visitor. |
protected static final char OPEN_SQUARE
protected static final char CLOSE_SQUARE
protected static final char DOUBLE_QUOTE
protected static final char SINGLE_QUOTE
public static <StrategyVisitor extends Visitor> StrategyVisitor visitAll(Visitable visitable, StrategyVisitor strategyVisitor)
object using a Visitors.NavigationVisitor (specifically a
Visitors.WalkAllVisitor), and with each of these visited objects calling the appropriate visit(...) method on the
supplied Visitor.StrategyVisitor - the type of strategy visitorvisitable - the top-level object to be visitedstrategyVisitor - the visitor that is to be called for each visited objects, but that does not call
Visitable.accept(Visitor)public static <GeneralVisitor extends Visitor> GeneralVisitor visit(Visitable visitable, GeneralVisitor visitor)
object using the supplied Visitor, which must be responsible for navigation as
well as any business logic.GeneralVisitor - the type of visitorvisitable - the top-level object to be visitedvisitor - the visitor that is to be usedpublic static String readable(Visitable visitable)
objectvisitable - the visitablepublic static String readable(Visitable visitable, ExecutionContext context)
objectvisitable - the visitablecontext - the execution context in which the visitable should be converted to a stringpublic static String readable(Object[] tuple, ExecutionContext context)
public static Collection<Subquery> subqueries(Visitable visitable, boolean includeNestedSubqueries)
Subquery objects that are contained within the supplied object. This
method does find Subquery objets nested in other Subquery objects.visitable - the visitableincludeNestedSubqueries - true if any Subquery objects within other Subquery objects should be included, or false if
only the top-level Subquery objects should be includedpublic static Map<SelectorName,SelectorName> getSelectorNamesByAlias(Visitable visitable)
visitable - the object to be visitedpublic static Map<SelectorName,SelectorName> getSelectorAliasesByName(Visitable visitable)
visitable - the object to be visitedpublic static Set<SelectorName> getSelectorsReferencedBy(Visitable visitable)
visitable - the object to be visitedCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.