public abstract class AbstractCoherenceQueryWalker extends Object implements TermWalker
| Modifier and Type | Field and Description |
|---|---|
protected CoherenceQueryLanguage |
f_language
The instance of
CoherenceQueryLanguage to use. |
protected PropertyBuilder |
f_propertyBuilder
The PropertyBuilder used to make getters and setters
|
protected Term |
f_termKeyFunction
Constant equal to an empty Key function term.
|
protected AtomicTerm |
m_atomicTerm
The AtomicTerm that was last processed
|
protected boolean |
m_fExtendedLanguage
Flag that controls whether we except Map, and List as literals.
|
protected List |
m_listBindVars
The current indexed list of bind variables.
|
protected com.tangosol.config.expression.ParameterResolver |
m_namedBindVars
The current named bind variables.
|
protected Object |
m_oResult
An Object that is the result of each classified dispatch as the
tree of Objects is built
|
protected String |
m_sAlias
The alias of the cache name being used.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCoherenceQueryWalker(List listBindVars,
com.tangosol.config.expression.ParameterResolver namedBindVars,
CoherenceQueryLanguage language)
Creates a AbstractCoherenceQueryWalker with the specified
bind variables.
|
| Modifier and Type | Method and Description |
|---|---|
void |
acceptAtom(String sFunctor,
AtomicTerm atomicTerm)
The receiver has been dispatched to from the given atom.
|
protected void |
acceptBinaryOperator(String sOperator,
Term termLeft,
Term termRight)
The receiver has classified a binary operation node.
|
protected void |
acceptCall(String sFunctionName,
NodeTerm term)
The receiver has classified a call node.
|
protected void |
acceptIdentifier(String sIdentifier)
The receiver has classified an identifier node.
|
protected boolean |
acceptIdentifierInternal(String sIdentifier)
Return true if the identifier specified is a well known identifier
('null', 'true' or 'false'), with a side-affect of
m_oResult
being set appropriately. |
protected void |
acceptKeyedBinding(String sName)
The receiver has classified a bind slot.
|
protected void |
acceptList(NodeTerm termList)
The receiver has classified a list node.
|
protected void |
acceptLiteral(AtomicTerm atom)
The receiver has classified a literal node.
|
void |
acceptNode(String sFunctor,
NodeTerm term)
The receiver has been dispatched to from the given node.
|
protected void |
acceptNumericBinding(int iVar)
The receiver has classified a bind slot.
|
protected void |
acceptPath(NodeTerm term)
The receiver has classified a path node.
|
protected void |
acceptPathAsChainedExtractor(String sCacheName,
NodeTerm nodeTerm)
Process the specified path term as a
ChainedExtractor. |
void |
acceptTerm(String sFunctor,
Term term)
The receiver has been dispatched to from the given atom.
|
protected void |
acceptUnaryOperator(String sOperator,
Term term)
The receiver has classified a unary operation node.
|
protected void |
append(StringBuilder sb,
Object[] aoObjects,
String sSeparator)
Append each of the values in the aoObjects array to the
StringBuilder
appending the specified separator between each value. |
protected ValueExtractor |
buildExtractor(List<ValueExtractor> listExtractors)
Create a single
ValueExtractor from the List of
ValueExtractors. |
Object |
getResult()
Return the result of the previous TermTree walk.
|
protected Object |
reflectiveMakeObject(boolean fUseNew,
Object oExtractor)
Use reflection to make Object either my calling a constructor or
static method.
|
void |
setAlias(String sAlias)
Set the alias that was used in naming caches.
|
void |
setExtendedLanguage(boolean fExtendedLanguage)
Set the flag that controls whether to process an "Extended Language" statement.
|
void |
setResult(Object oResult)
Set the value for the result object.
|
Object |
walk(Term term)
Return the result of the walking the specified TermTree.
|
protected final CoherenceQueryLanguage f_language
CoherenceQueryLanguage to use.protected String m_sAlias
protected Object m_oResult
protected AtomicTerm m_atomicTerm
protected final PropertyBuilder f_propertyBuilder
protected boolean m_fExtendedLanguage
protected List m_listBindVars
protected com.tangosol.config.expression.ParameterResolver m_namedBindVars
protected final Term f_termKeyFunction
protected AbstractCoherenceQueryWalker(List listBindVars, com.tangosol.config.expression.ParameterResolver namedBindVars, CoherenceQueryLanguage language)
listBindVars - the indexed ind variablesnamedBindVars - the named bind variableslanguage - the CoherenceQueryLanguage instance to usepublic void acceptNode(String sFunctor, NodeTerm term)
TermWalkeracceptNode in interface TermWalkersFunctor - the node functorterm - the NodeTermpublic void acceptAtom(String sFunctor, AtomicTerm atomicTerm)
TermWalkeracceptAtom in interface TermWalkersFunctor - the node functoratomicTerm - the AtomicTermpublic void acceptTerm(String sFunctor, Term term)
TermWalkeracceptTerm in interface TermWalkersFunctor - the node functorterm - the Termpublic Object walk(Term term)
TermWalkerwalk in interface TermWalkerterm - the term tree to walk to obtain a result objectprotected void acceptLiteral(AtomicTerm atom)
atom - the term representing the literalprotected void acceptList(NodeTerm termList)
termList - the Term whose children represent the elements of the listprotected void acceptIdentifier(String sIdentifier)
sIdentifier - the String representing the identifierprotected boolean acceptIdentifierInternal(String sIdentifier)
m_oResult
being set appropriately.sIdentifier - the identifier to acceptprotected void acceptBinaryOperator(String sOperator, Term termLeft, Term termRight)
sOperator - the string representing the operatortermLeft - the left Term of the operationtermRight - the right Term of the operationprotected void acceptUnaryOperator(String sOperator, Term term)
sOperator - the string representing the operatorterm - the Term being operated uponprotected void acceptNumericBinding(int iVar)
iVar - the 1-based index into the bind variablesprotected void acceptKeyedBinding(String sName)
sName - the name of the bind variable to useprotected void acceptCall(String sFunctionName, NodeTerm term)
sFunctionName - the function nameterm - a Term whose children are the parameters to the callprotected void acceptPath(NodeTerm term)
term - a Term whose children are the elements of the pathprotected void acceptPathAsChainedExtractor(String sCacheName, NodeTerm nodeTerm)
ChainedExtractor.sCacheName - the cache name the extractor will be executed onnodeTerm - the NodeTerm containing the path to use
to build the ChainedExtractorprotected ValueExtractor buildExtractor(List<ValueExtractor> listExtractors)
ValueExtractor from the List of
ValueExtractors.
If the List contains a single ValueExtractor then that is returned
from this method. If the List contains multiple ValueExtractors
then these are combined into a ChainedExtractor.
listExtractors - the List of ValueExtractors to usepublic void setExtendedLanguage(boolean fExtendedLanguage)
fExtendedLanguage - flag that determines whether to process
an extended languagepublic void setResult(Object oResult)
oResult - the value to set as the resultpublic Object getResult()
TermWalkergetResult in interface TermWalkerprotected Object reflectiveMakeObject(boolean fUseNew, Object oExtractor)
fUseNew - flag that controls whether to use constructoroExtractor - the ReflectionExtractor or array of ReflectionExtractorsprotected void append(StringBuilder sb, Object[] aoObjects, String sSeparator)
StringBuilder
appending the specified separator between each value.sb - the StringBuilder to append the values toaoObjects - the values to append to the StringBuildersSeparator - the separator to usepublic void setAlias(String sAlias)
sAlias - The String that is the alias