abstract class QueryProfileVisitor extends Object
Visitor are called in the following sequence on each query profile:
enter=enter(referenceName);
onQueryProfile(this)
if (enter) {
getLocalKey()
...calls on nested content found in variants, this and inherited, in that order
leave(referenceName)
}
The first enter call will be on the root node, which has an empt reference name.
Constructor and Description |
---|
QueryProfileVisitor() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
acceptValue(String key,
Object value,
DimensionBinding dimensionBinding,
QueryProfile owner)
Calls onValue or onQueryProfile on this and visits the content if it's a profile
|
boolean |
enter(String name)
Called when a new nested profile in the graph is entered.
|
abstract String |
getLocalKey()
Returns the current local key which should be visited in the last
entered sub-profile
(or in the top level profile if none is entered), or null to visit all content |
abstract boolean |
isDone()
Returns whether this visitor is done visiting what it needed to visit at this point
|
void |
leave(String name)
Called when the last
entered nested profile is left. |
abstract void |
onQueryProfile(QueryProfile profile,
DimensionBinding binding,
QueryProfile owner)
Called when a query profile is encountered.
|
abstract void |
onValue(String localName,
Object value,
DimensionBinding binding,
QueryProfile owner)
Called when a value (not a query profile) is encountered.
|
boolean |
visitInherited()
Returns whether we should, at this point, visit inherited profiles.
|
public boolean enter(String name)
leave(String)
call will happen
later.name
- the name this profile is nested as, or the empty string if we are entering the root profilepublic void leave(String name)
entered
nested profile is left.
That is: One leave call is made for each enter call which returns true,
but due to nesting those calls are not necessarily alternating.
This default implementation does nothing.public abstract void onValue(String localName, Object value, DimensionBinding binding, QueryProfile owner)
localName
- the local name of this value (the full name, if needed, must be reconstructed
by the information given by the history of enter(String)
and leave(String)
callsvalue
- the valuebinding
- the binding this holds forowner
- the query profile having this value, or null only when profile is the root profilepublic abstract void onQueryProfile(QueryProfile profile, DimensionBinding binding, QueryProfile owner)
profile
- the query profile reference encounteredbinding
- the binding this holds forowner
- the profile making this reference, or null only when profile is the root profilepublic abstract boolean isDone()
public boolean visitInherited()
public abstract String getLocalKey()
entered
sub-profile
(or in the top level profile if none is entered), or null to visit all contentfinal void acceptValue(String key, Object value, DimensionBinding dimensionBinding, QueryProfile owner)
Copyright © 2017. All rights reserved.