public class VariableDeclarationsCompositor extends java.lang.Object implements VariableDeclarations
hasVariable(String)
and getVariable(String)
methods to other variable declarations.
Each variable declaration combined is checked in sequential order.
No checks for conflicts are done. Thus shadowing is possible.Constructor and Description |
---|
VariableDeclarationsCompositor(VariableDeclarations... declarations)
Constructs a
VariableDeclarationsCompositor containing the provided
declarations |
Modifier and Type | Method and Description |
---|---|
Node |
getVariable(java.lang.String name)
Tries to fetch a variable from one of the combined declarations.
|
boolean |
hasVariable(java.lang.String name)
Whether the variable is contained in one of the combined declarations.
|
public VariableDeclarationsCompositor(VariableDeclarations... declarations)
VariableDeclarationsCompositor
containing the provided
declarations
The order of the declarations will determine the order of checking the
declarations for variables.declarations
- the declarations being combinedpublic boolean hasVariable(java.lang.String name)
hasVariable
in interface VariableDeclarations
name
- name of the variablepublic Node getVariable(java.lang.String name)
VariableDeclarations
applies here too.getVariable
in interface VariableDeclarations
name
- the name of the variable to be fetched