findVariable
public Element findVariable(String reference,
TreePath path)
Finds the variable referenced in the passed String
.
This method may only operate on variable references, e.g. local
variables, parameters, fields.
The reference string may be either an single Java identifier (e.g. "field")
or dot-separated identifiers (e.g. "Collections.EMPTY_LIST").
The method adheres to all the rules of Java's scoping (while also
considering the imports) for name resolution.
- Parameters:
reference
- the variable reference string
path
- the tree path to the local scope
- Returns:
- the variable reference