AstHelper.Mode| Constructor and Description |
|---|
AstHelperImpl(com.sun.tools.javac.util.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
addArgToAnnotation(Node<com.sun.tools.javac.tree.JCTree.JCAnnotation> annotationNode,
Node<com.sun.tools.javac.tree.JCTree.JCAssign> arg)
Adds node arg representing assignment to a set of arguments of annotation represented by annotationNode.
|
void |
addElementToClass(Node<com.sun.tools.javac.tree.JCTree.JCClassDecl> clazz,
Node element,
AstHelper.Mode mode,
int offset)
Adds node to a specified class according to the mode and offset.
|
<T extends com.sun.tools.javac.tree.JCTree.JCExpressionStatement> |
addExpressionStatementToConstructor(Node<com.sun.tools.javac.tree.JCTree.JCMethodDecl> method,
Node<T> expressionStatement,
AstHelper.Mode mode,
int offset)
Does the same as
AstHelper.addExpressionStatementToMethod(Node, Node, Mode, int) but takes into account
presence of super() invocation. |
<T extends com.sun.tools.javac.tree.JCTree.JCExpressionStatement> |
addExpressionStatementToMethod(Node<com.sun.tools.javac.tree.JCTree.JCMethodDecl> method,
Node<T> expressionStatement,
AstHelper.Mode mode,
int offset)
Adds node representing expression statement to a specified method according to the mode and offset.
|
Node<com.sun.tools.javac.tree.JCTree.JCVariableDecl> |
findFieldByNameAndType(Node<com.sun.tools.javac.tree.JCTree.JCClassDecl> classDeclNode,
Name name) |
Map<Node,Node> |
getAnnotationSourceMap(Collection<Node> annotationNodes,
String sourceQualifiedName) |
Map<String,Object> |
getAnnotationValues(Node<com.sun.tools.javac.tree.JCTree.JCAnnotation> annotationNode) |
AstNodeBuilder |
getAstNodeBuilder()
Returns Kendal AST Nodes builder which let's you create new AST nodes in easier way.
|
AstUtils |
getAstUtils()
Returns Kendal AST Utils which is a collection of utilities methods.
|
AstValidator |
getAstValidator()
Returns Kendal AST validator which contains some basic validations methods.
|
com.sun.tools.javac.util.Context |
getContext()
Returns context which allows to obtain objects from javac compiler.
|
void |
replaceNode(Node<? extends com.sun.tools.javac.tree.JCTree> parent,
Node<? extends com.sun.tools.javac.tree.JCTree> oldNode,
Node<? extends com.sun.tools.javac.tree.JCTree> newNode)
In the given parent node replaces oldNode node with the newNode.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddElementToClasspublic void addElementToClass(Node<com.sun.tools.javac.tree.JCTree.JCClassDecl> clazz, Node element, AstHelper.Mode mode, int offset)
AstHelperaddElementToClass in interface AstHelperclazz - node representing class that is to be modifiedelement - element to be added to the classmode - either PREPEND or APPEND, defines whether we add from the beginning or the endoffset - number of lines to be skipped before element is addedpublic void addArgToAnnotation(Node<com.sun.tools.javac.tree.JCTree.JCAnnotation> annotationNode, Node<com.sun.tools.javac.tree.JCTree.JCAssign> arg)
AstHelperaddArgToAnnotation in interface AstHelperpublic void replaceNode(Node<? extends com.sun.tools.javac.tree.JCTree> parent, Node<? extends com.sun.tools.javac.tree.JCTree> oldNode, Node<? extends com.sun.tools.javac.tree.JCTree> newNode)
AstHelperreplaceNode in interface AstHelperpublic <T extends com.sun.tools.javac.tree.JCTree.JCExpressionStatement> void addExpressionStatementToMethod(Node<com.sun.tools.javac.tree.JCTree.JCMethodDecl> method, Node<T> expressionStatement, AstHelper.Mode mode, int offset)
AstHelperaddExpressionStatementToMethod in interface AstHelpermethod - node representing method that is to be modifiedexpressionStatement - element to be added to the methodmode - either PREPEND or APPEND, defines whether we add from the beginning or the endoffset - number of lines to be skipped before element is addedpublic <T extends com.sun.tools.javac.tree.JCTree.JCExpressionStatement> void addExpressionStatementToConstructor(Node<com.sun.tools.javac.tree.JCTree.JCMethodDecl> method, Node<T> expressionStatement, AstHelper.Mode mode, int offset)
AstHelperAstHelper.addExpressionStatementToMethod(Node, Node, Mode, int) but takes into account
presence of super() invocation. If present and PREPEND mode is selected, expression statement is added after it.addExpressionStatementToConstructor in interface AstHelperpublic Node<com.sun.tools.javac.tree.JCTree.JCVariableDecl> findFieldByNameAndType(Node<com.sun.tools.javac.tree.JCTree.JCClassDecl> classDeclNode, Name name)
findFieldByNameAndType in interface AstHelperpublic com.sun.tools.javac.util.Context getContext()
AstHelpergetContext in interface AstHelperpublic AstNodeBuilder getAstNodeBuilder()
AstHelpergetAstNodeBuilder in interface AstHelperpublic AstValidator getAstValidator()
AstHelpergetAstValidator in interface AstHelperpublic AstUtils getAstUtils()
AstHelpergetAstUtils in interface AstHelperpublic Map<Node,Node> getAnnotationSourceMap(Collection<Node> annotationNodes, String sourceQualifiedName)
getAnnotationSourceMap in interface AstHelperCopyright © 2019. All rights reserved.