final class SingleValueQueryProfileVisitor extends QueryProfileVisitor
Modifier and Type | Field and Description |
---|---|
private boolean |
allowQueryProfileResult |
private boolean |
enteringContent |
private List<String> |
name |
private int |
nameIndex |
private Object |
value
The value found, or null if none
|
Constructor and Description |
---|
SingleValueQueryProfileVisitor(List<String> name,
boolean allowQueryProfileResult) |
Modifier and Type | Method and Description |
---|---|
boolean |
enter(String name)
Called when a new nested profile in the graph is entered.
|
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 |
Object |
getResult()
Returns the value found during visiting, or null if none
|
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. |
void |
onQueryProfile(QueryProfile profile,
DimensionBinding binding,
QueryProfile owner)
Called when a query profile is encountered.
|
void |
onValue(String key,
Object value,
DimensionBinding binding,
QueryProfile owner)
Called when a value (not a query profile) is encountered.
|
String |
toString() |
acceptValue, visitInherited
private Object value
private int nameIndex
private final boolean allowQueryProfileResult
private boolean enteringContent
public String getLocalKey()
QueryProfileVisitor
entered
sub-profile
(or in the top level profile if none is entered), or null to visit all contentgetLocalKey
in class QueryProfileVisitor
public boolean enter(String name)
QueryProfileVisitor
QueryProfileVisitor.leave(String)
call will happen
later.enter
in class QueryProfileVisitor
name
- the name this profile is nested as, or the empty string if we are entering the root profilepublic void leave(String name)
QueryProfileVisitor
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.leave
in class QueryProfileVisitor
public void onValue(String key, Object value, DimensionBinding binding, QueryProfile owner)
QueryProfileVisitor
onValue
in class QueryProfileVisitor
key
- the local name of this value (the full name, if needed, must be reconstructed
by the information given by the history of QueryProfileVisitor.enter(String)
and QueryProfileVisitor.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 void onQueryProfile(QueryProfile profile, DimensionBinding binding, QueryProfile owner)
QueryProfileVisitor
onQueryProfile
in class QueryProfileVisitor
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 boolean isDone()
QueryProfileVisitor
isDone
in class QueryProfileVisitor
public Object getResult()
Copyright © 2018. All rights reserved.