Purpose: The ParseTreeContext holds and manages context information for the parse tree for validation.
Responsibilities:
ParseTree
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | ParseTreeContext.VariableDecl
INTERNAL Class defining the type of the values the variableDecls map. |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private int | |
| private Map | |
| private NodeFactory | |
| private Set | |
| private List | |
| private Map | |
| private String | |
| private TypeHelper | |
| private Map |
| Access | Constructor and Description |
|---|---|
| public | ParseTreeContext(NodeFactory nodeFactory, String queryInfo)
INTERNAL Return a new initialized ParseTreeContext |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Class | classForSchemaName(String schemaName, GenerationContext context)
INTERNAL Answer the class associated with the provided schema name |
| public void | defineParameterType(String parameterName, Object parameterType, int line, int column)
INTERNAL Defines the type of the parameter with the specified name. |
| public void | |
| public String | |
| public List | getFetchJoins(String variableName)
Returns a list of FETCH JOIN nodes for the specified attached to the specified variable. |
| public NodeFactory | |
| public Set | |
| public List | |
| public Object | |
| public String | |
| public TypeHelper | |
| public Set | getUnusedVariables()
Returns s set of variables that are declared in the current scope, but not used in the query. |
| public String | getVariableNameForClass(Class<?> theClass, GenerationContext context)
INTERNAL getVariableNameForClass(): Answer the name mapped to the specified class. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isDeclaredInOuterScope(String variable)
INTERNAL Returns true if the specified string denotes a variable declared in an outer scope. |
| public boolean | isRangeVariable(String variable)
INTERNAL Returns true if the specified string denotes a range variable. |
| public boolean | |
| public void | |
| public Node | pathForVariable(String variable)
INTERNAL Returns the path if the specified string denotes a join or collection member variable. |
| public void | registerFetchJoin(String variableName, Node node)
Associate the given variableName with the given node representing a JOIN FETCH node. |
| public void | registerJoinVariable(String variable, Node path, int line, int column)
INTERNAL Associate the given path with the given variable. |
| public void | registerOuterScopeVariable(String variable)
INTERNAL Adds the specified variable to the set of outer scope variables. |
| public void | registerSchema(String variable, String schema, int line, int column)
INTERNAL Associate the given schema with the given variable. |
| public void | |
| public void | |
| public String | schemaForVariable(String variable)
INTERNAL Returns the abstract schema name if the specified string denotes a range variable. |
| public void | |
| public void | setScopeOfVariable(String variable)
INTERNAL Sets the scope of the specified variable to the current scope. |
| public void | |
| public void | |
| public void | usedVariable(String variable)
Mark the specified variable as used if it is declared in the current scope. |
| baseVariable | back to summary |
|---|---|
| private String baseVariable | |
| currentScope | back to summary |
|---|---|
| private int currentScope | |
| fetchJoins | back to summary |
|---|---|
| private Map<String, List<Node>> fetchJoins | |
| nodeFactory | back to summary |
|---|---|
| private NodeFactory nodeFactory | |
| outerScopeVariables | back to summary |
|---|---|
| private Set<String> outerScopeVariables | |
| parameterNames | back to summary |
|---|---|
| private List<String> parameterNames | |
| parameterTypes | back to summary |
|---|---|
| private Map<String, Object> parameterTypes | |
| queryInfo | back to summary |
|---|---|
| private String queryInfo | |
| typeHelper | back to summary |
|---|---|
| private TypeHelper typeHelper | |
| variableDecls | back to summary |
|---|---|
| private Map<String, ParseTreeContext. | |
| ParseTreeContext | back to summary |
|---|---|
| public ParseTreeContext(NodeFactory nodeFactory, String queryInfo) INTERNAL Return a new initialized ParseTreeContext | |
| addParameter | back to summary |
|---|---|
| public void addParameter(String parameterName) INTERNAL Add a parameter. | |
| classForSchemaName | back to summary |
|---|---|
| public Class INTERNAL Answer the class associated with the provided schema name | |
| defineParameterType | back to summary |
|---|---|
| public void defineParameterType(String parameterName, Object parameterType, int line, int column) INTERNAL Defines the type of the parameter with the specified name. | |
| enterScope | back to summary |
|---|---|
| public void enterScope() INTERNAL Enters a new scope. This initializes the set of outer scope variables. | |
| getBaseVariable | back to summary |
|---|---|
| public String getBaseVariable() | |
| getFetchJoins | back to summary |
|---|---|
| public List Returns a list of FETCH JOIN nodes for the specified attached to the specified variable. | |
| getNodeFactory | back to summary |
|---|---|
| public NodeFactory getNodeFactory() | |
| getOuterScopeVariables | back to summary |
|---|---|
| public Set INTERNAL Returns the set of outer scope variables. | |
| getParameterNames | back to summary |
|---|---|
| public List INTERNAL Return the parameter names. | |
| getParameterType | back to summary |
|---|---|
| public Object getParameterType(String parameter) INTERNAL Return the type of the specified parameter. | |
| getQueryInfo | back to summary |
|---|---|
| public String getQueryInfo() | |
| getTypeHelper | back to summary |
|---|---|
| public TypeHelper getTypeHelper() INTERNAL Returns the type helper stored in this context. | |
| getUnusedVariables | back to summary |
|---|---|
| public Set Returns s set of variables that are declared in the current scope, but not used in the query. | |
| getVariableNameForClass | back to summary |
|---|---|
| public String getVariableNameForClass(Class<?> theClass, GenerationContext context) INTERNAL getVariableNameForClass(): Answer the name mapped to the specified class. Answer null if none found. SELECT OBJECT (emp) FROM Employee emp getVariableNameForClass(Employee.class) => "emp" | |
| hasMoreThanOneAliasInFrom | back to summary |
|---|---|
| public boolean hasMoreThanOneAliasInFrom() | |
| hasMoreThanOneVariablePerType | back to summary |
|---|---|
| public boolean hasMoreThanOneVariablePerType() | |
| hasParameters | back to summary |
|---|---|
| public boolean hasParameters() INTERNAL Returns true if the query has at least one parameter. | |
| isDeclaredInOuterScope | back to summary |
|---|---|
| public boolean isDeclaredInOuterScope(String variable) INTERNAL Returns true if the specified string denotes a variable declared in an outer scope. | |
| isRangeVariable | back to summary |
|---|---|
| public boolean isRangeVariable(String variable) INTERNAL Returns true if the specified string denotes a range variable. | |
| isVariable | back to summary |
|---|---|
| public boolean isVariable(String variable) INTERNAL Returns true if the specified string denotes a variable. | |
| leaveScope | back to summary |
|---|---|
| public void leaveScope() INTERNAL Leaves the current scope. | |
| pathForVariable | back to summary |
|---|---|
| public Node pathForVariable(String variable) INTERNAL Returns the path if the specified string denotes a join or collection member variable. | |
| registerFetchJoin | back to summary |
|---|---|
| public void registerFetchJoin(String variableName, Node node) Associate the given variableName with the given node representing a JOIN FETCH node. | |
| registerJoinVariable | back to summary |
|---|---|
| public void registerJoinVariable(String variable, Node path, int line, int column) INTERNAL Associate the given path with the given variable. | |
| registerOuterScopeVariable | back to summary |
|---|---|
| public void registerOuterScopeVariable(String variable) INTERNAL Adds the specified variable to the set of outer scope variables. | |
| registerSchema | back to summary |
|---|---|
| public void registerSchema(String variable, String schema, int line, int column) INTERNAL Associate the given schema with the given variable. | |
| resetOuterScopeVariables | back to summary |
|---|---|
| public void resetOuterScopeVariables() INTERNAL Resets the set of outer scope variables. | |
| resetOuterScopeVariables | back to summary |
|---|---|
| public void resetOuterScopeVariables(Set<String> variables) INTERNAL Resets the set of outer scope variables. | |
| schemaForVariable | back to summary |
|---|---|
| public String schemaForVariable(String variable) INTERNAL Returns the abstract schema name if the specified string denotes a range variable. | |
| setBaseVariable | back to summary |
|---|---|
| public void setBaseVariable(String variable) | |
| setScopeOfVariable | back to summary |
|---|---|
| public void setScopeOfVariable(String variable) INTERNAL Sets the scope of the specified variable to the current scope. | |
| setTypeHelper | back to summary |
|---|---|
| public void setTypeHelper(TypeHelper typeHelper) INTERNAL Stores the specified type helper in this context. | |
| unregisterVariable | back to summary |
|---|---|
| public void unregisterVariable(String variable) INTERNAL | |
| usedVariable | back to summary |
|---|---|
| public void usedVariable(String variable) Mark the specified variable as used if it is declared in the current scope. | |
| Modifier and Type | Field and Description |
|---|---|
| public final boolean | |
| public final Node | |
| public final String | |
| public int | |
| public boolean | |
| public final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| isRangeVariable | back to summary |
|---|---|
| public final boolean isRangeVariable | |
| path | back to summary |
|---|---|
| public final Node path | |
| schema | back to summary |
|---|---|
| public final String schema | |
| scope | back to summary |
|---|---|
| public int scope | |
| used | back to summary |
|---|---|
| public boolean used | |
| variable | back to summary |
|---|---|
| public final String variable | |
| VariableDecl | back to summary |
|---|---|
| public VariableDecl(String variable, String schema) | |
| VariableDecl | back to summary |
|---|---|
| public VariableDecl(String variable, Node path) | |