|
Lombok - v0.10.8 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlombok.core.AST<JavacAST,JavacNode,com.sun.tools.javac.tree.JCTree>
lombok.javac.JavacAST
public class JavacAST
Wraps around javac's internal AST view to add useful features as well as the ability to visit parents from children, something javac's own AST system does not offer.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class lombok.core.AST |
---|
AST.FieldAccess, AST.Kind |
Constructor Summary | |
---|---|
JavacAST(Messager messager,
com.sun.tools.javac.util.Context context,
com.sun.tools.javac.tree.JCTree.JCCompilationUnit top)
Creates a new JavacAST of the provided Compilation Unit. |
Method Summary | |
---|---|
protected JavacNode |
buildTree(com.sun.tools.javac.tree.JCTree node,
AST.Kind kind)
Build an AST.Node object for the stated internal (javac/Eclipse) AST Node object. |
com.sun.tools.javac.util.Context |
getContext()
|
protected Collection<Class<? extends com.sun.tools.javac.tree.JCTree>> |
getStatementTypes()
For javac, both JCExpression and JCStatement are considered as valid children types. |
com.sun.tools.javac.code.Symtab |
getSymbolTable()
|
com.sun.tools.javac.tree.TreeMaker |
getTreeMaker()
|
com.sun.tools.javac.model.JavacTypes |
getTypesUtil()
|
protected void |
setElementInASTCollection(Field field,
Object refField,
List<Collection<?>> chain,
Collection<?> collection,
int idx,
com.sun.tools.javac.tree.JCTree newN)
Override if your AST collection does not support the set method. |
com.sun.tools.javac.util.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. |
Methods inherited from class lombok.core.AST |
---|
buildWithField, clearChanged, clearState, fieldsOf, get, getFileName, getImportStatements, getNodeMap, getPackageDeclaration, isChanged, putInMap, replaceStatementInNode, setAndGetAsHandled, setChanged, setTop, top |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavacAST(Messager messager, com.sun.tools.javac.util.Context context, com.sun.tools.javac.tree.JCTree.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.Method Detail |
---|
public com.sun.tools.javac.util.Context getContext()
public void traverse(JavacASTVisitor visitor)
public com.sun.tools.javac.util.Name toName(String name)
public com.sun.tools.javac.tree.TreeMaker getTreeMaker()
public com.sun.tools.javac.code.Symtab getSymbolTable()
public com.sun.tools.javac.model.JavacTypes getTypesUtil()
Types
of javac. Contains a few extra methods beyond
the ones listed in the official annotation API interface.protected JavacNode buildTree(com.sun.tools.javac.tree.JCTree node, AST.Kind kind)
buildTree
in class AST<JavacAST,JavacNode,com.sun.tools.javac.tree.JCTree>
protected Collection<Class<? extends com.sun.tools.javac.tree.JCTree>> getStatementTypes()
getStatementTypes
in class AST<JavacAST,JavacNode,com.sun.tools.javac.tree.JCTree>
protected void setElementInASTCollection(Field field, Object refField, List<Collection<?>> chain, Collection<?> collection, int idx, com.sun.tools.javac.tree.JCTree newN) throws IllegalAccessException
setElementInASTCollection
in class AST<JavacAST,JavacNode,com.sun.tools.javac.tree.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.
|
Lombok - v0.10.8 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |