AST.FieldAccess, AST.Kind
Constructor and Description |
---|
JavacAST(Messager messager,
Context context,
JCCompilationUnit top)
Creates a new JavacAST of the provided Compilation Unit.
|
Modifier and Type | Method and Description |
---|---|
protected JavacNode |
buildTree(JCTree node,
AST.Kind kind)
Build an AST.Node object for the stated internal (javac/Eclipse) AST Node object.
|
URI |
getAbsoluteFileLocation()
Attempts to find the absolute path (in URI form) to the source file represented by this AST.
|
Context |
getContext() |
int |
getLatestJavaSpecSupported()
Returns the latest version of the java language specification supported by the host compiler.
|
int |
getSourceVersion()
Returns the JLS spec version that the compiler uses to parse and compile this AST.
|
protected Collection<Class<? extends JCTree>> |
getStatementTypes()
For javac, both JCExpression and JCStatement are considered as valid children types.
|
Symtab |
getSymbolTable() |
lombok.javac.JavacTreeMaker |
getTreeMaker() |
JavacTypes |
getTypesUtil() |
void |
removeFromDeferredDiagnostics(int startPos,
int endPos) |
protected void |
setElementInASTCollection(Field field,
Object refField,
List<Collection<?>> chain,
Collection<?> collection,
int idx,
JCTree newN)
Override if your AST collection does not support the set method.
|
Name |
toName(String name) |
void |
traverse(JavacASTVisitor visitor)
Runs through the entire AST, starting at the compilation unit, calling the provided visitor's visit methods
for each node, depth first.
|
buildWithField, clearChanged, clearState, fieldsOf, get, getFileName, getImportList, getNodeMap, getPackageDeclaration, isChanged, putInMap, readConfiguration, replaceStatementInNode, setAndGetAsHandled, setChanged, setTop, shouldDrill, top
public JavacAST(Messager messager, Context context, JCCompilationUnit top)
messager
- A Messager for warning and error reporting.context
- A Context object for interfacing with the compiler.top
- The compilation unit, which serves as the top level node in the tree to be built.public URI getAbsoluteFileLocation()
AST
null
if this cannot be done. We don't yet know under which conditions this will happen.getAbsoluteFileLocation
in class AST<JavacAST,JavacNode,JCTree>
public Context getContext()
public void traverse(JavacASTVisitor visitor)
public int getSourceVersion()
AST
6
.getSourceVersion
in class AST<JavacAST,JavacNode,JCTree>
public int getLatestJavaSpecSupported()
AST
7
.
NB: Even if -source (lower than maximum) is specified, this method still returns the maximum supported number.getLatestJavaSpecSupported
in class AST<JavacAST,JavacNode,JCTree>
public Name toName(String name)
public lombok.javac.JavacTreeMaker getTreeMaker()
public Symtab getSymbolTable()
public JavacTypes getTypesUtil()
Types
of javac. Contains a few extra methods beyond
the ones listed in the official annotation API interface.protected JavacNode buildTree(JCTree node, AST.Kind kind)
protected Collection<Class<? extends JCTree>> getStatementTypes()
getStatementTypes
in class AST<JavacAST,JavacNode,JCTree>
public void removeFromDeferredDiagnostics(int startPos, int endPos)
protected void setElementInASTCollection(Field field, Object refField, List<Collection<?>> chain, Collection<?> collection, int idx, JCTree newN) throws IllegalAccessException
setElementInASTCollection
in class AST<JavacAST,JavacNode,JCTree>
field
- The field that contains the array or list of AST nodes.refField
- The object that you can supply to the field's get
method.chain
- If the collection is immutable, you need to update the pointer to the collection in each element in the chain.IllegalAccessException
- This exception won't happen, but we allow you to throw it so you can avoid having to catch it.Copyright © 2009-2015 The Project Lombok Authors, licensed under the MIT licence.