public class ParseTreeContext
extends java.lang.Object
Purpose: The ParseTreeContext holds and manages context information for the parse tree for validation.
Responsibilities:
ParseTree
Constructor and Description |
---|
ParseTreeContext(NodeFactory nodeFactory,
java.lang.String queryInfo)
INTERNAL
Return a new initialized ParseTreeContext
|
Modifier and Type | Method and Description |
---|---|
void |
addParameter(java.lang.String parameterName)
INTERNAL
Add a parameter.
|
java.lang.Class |
classForSchemaName(java.lang.String schemaName,
GenerationContext context)
INTERNAL
Answer the class associated with the provided schema name
|
void |
defineParameterType(java.lang.String parameterName,
java.lang.Object parameterType,
int line,
int column)
INTERNAL
Defines the type of the parameter with the specified name.
|
void |
enterScope()
INTERNAL
Enters a new scope.
|
java.lang.String |
getBaseVariable() |
java.util.List |
getFetchJoins(java.lang.String variableName)
Returns a list of FETCH JOIN nodes for the specified attached to the
specified variable.
|
NodeFactory |
getNodeFactory() |
java.util.Set |
getOuterScopeVariables()
INTERNAL
Returns the set of outer scope variables.
|
java.util.List |
getParameterNames()
INTERNAL
Return the parameter names.
|
java.lang.Object |
getParameterType(java.lang.String parameter)
INTERNAL
Return the type of the specified parameter.
|
java.lang.String |
getQueryInfo() |
TypeHelper |
getTypeHelper()
INTERNAL
Returns the type helper stored in this context.
|
java.util.Set |
getUnusedVariables()
Returns s set of variables that are declared in the current scope,
but not used in the query.
|
java.lang.String |
getVariableNameForClass(java.lang.Class theClass,
GenerationContext context)
INTERNAL
getVariableNameForClass():
Answer the name mapped to the specified class.
|
boolean |
hasMoreThanOneAliasInFrom() |
boolean |
hasMoreThanOneVariablePerType() |
boolean |
hasParameters()
INTERNAL
Returns true if the query has at least one parameter.
|
boolean |
isDeclaredInOuterScope(java.lang.String variable)
INTERNAL
Returns true if the specified string denotes a variable declared in an
outer scope.
|
boolean |
isRangeVariable(java.lang.String variable) |
boolean |
isVariable(java.lang.String variable)
INTERNAL
Returns true if the specified string denotes a variable.
|
void |
leaveScope()
INTERNAL
Leaves the current scope.
|
Node |
pathForVariable(java.lang.String variable)
INTERNAL
Returns the path if the specified string denotes a join or collection
member variable.
|
void |
registerFetchJoin(java.lang.String variableName,
Node node)
Associate the given variableName with the given node representing a
JOIN FETCH node.
|
void |
registerJoinVariable(java.lang.String variable,
Node path,
int line,
int column)
INTERNAL
Associate the given path with the given variable.
|
void |
registerOuterScopeVariable(java.lang.String variable)
INTERNAL
Adds the specified variable to the set of outer scope variables.
|
void |
registerSchema(java.lang.String variable,
java.lang.String schema,
int line,
int column)
INTERNAL
Associate the given schema with the given variable.
|
void |
resetOuterScopeVariables()
INTERNAL
Resets the set of outer scope variables.
|
void |
resetOuterScopeVariables(java.util.Set variables)
INTERNAL
Resets the set of outer scope variables.
|
java.lang.String |
schemaForVariable(java.lang.String variable)
INTERNAL
Returns the abstract schema name if the specified string denotes a
range variable.
|
void |
setBaseVariable(java.lang.String variable) |
void |
setScopeOfVariable(java.lang.String variable)
INTERNAL
Sets the scope of the specified variable to the current scope.
|
void |
setTypeHelper(TypeHelper typeHelper)
INTERNAL
Stores the specified type helper in this context.
|
void |
unregisterVariable(java.lang.String variable)
INTERNAL
|
void |
usedVariable(java.lang.String variable)
Mark the specified variable as used if it is declared in the current
scope.
|
public ParseTreeContext(NodeFactory nodeFactory, java.lang.String queryInfo)
public void registerSchema(java.lang.String variable, java.lang.String schema, int line, int column)
public void registerJoinVariable(java.lang.String variable, Node path, int line, int column)
public void unregisterVariable(java.lang.String variable)
public boolean isVariable(java.lang.String variable)
public boolean isRangeVariable(java.lang.String variable)
public java.lang.String schemaForVariable(java.lang.String variable)
public java.lang.Class classForSchemaName(java.lang.String schemaName, GenerationContext context)
public java.lang.String getVariableNameForClass(java.lang.Class theClass, GenerationContext context)
public Node pathForVariable(java.lang.String variable)
public java.lang.String getBaseVariable()
public void setBaseVariable(java.lang.String variable)
public NodeFactory getNodeFactory()
public java.lang.String getQueryInfo()
public boolean isDeclaredInOuterScope(java.lang.String variable)
public void setScopeOfVariable(java.lang.String variable)
public void enterScope()
public void leaveScope()
public void registerOuterScopeVariable(java.lang.String variable)
public java.util.Set getOuterScopeVariables()
public void resetOuterScopeVariables()
public void resetOuterScopeVariables(java.util.Set variables)
public void registerFetchJoin(java.lang.String variableName, Node node)
public java.util.List getFetchJoins(java.lang.String variableName)
public void usedVariable(java.lang.String variable)
public java.util.Set getUnusedVariables()
public boolean hasMoreThanOneVariablePerType()
public boolean hasMoreThanOneAliasInFrom()
public TypeHelper getTypeHelper()
public void setTypeHelper(TypeHelper typeHelper)
public void addParameter(java.lang.String parameterName)
public void defineParameterType(java.lang.String parameterName, java.lang.Object parameterType, int line, int column)
public boolean hasParameters()
public java.lang.Object getParameterType(java.lang.String parameter)
public java.util.List getParameterNames()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference