public class GrabAnnotationTransformation extends ClassCodeVisitorSupport implements ASTTransformation, CompilationUnitAware
Constructor and Description |
---|
GrabAnnotationTransformation() |
Modifier and Type | Method and Description |
---|---|
SourceUnit |
getSourceUnit() |
void |
setCompilationUnit(CompilationUnit compilationUnit) |
void |
visit(ASTNode[] nodes,
SourceUnit source)
The method is invoked when an AST Transformation is active.
|
void |
visitAnnotations(AnnotatedNode node)
Adds the annotation to the internal target list if a match is found.
|
addError, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop
visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression
public SourceUnit getSourceUnit()
getSourceUnit
in class ClassCodeVisitorSupport
public void setCompilationUnit(CompilationUnit compilationUnit)
setCompilationUnit
in interface CompilationUnitAware
public void visit(ASTNode[] nodes, SourceUnit source)
ASTTransformation
visit
in interface ASTTransformation
nodes
- The ASTnodes when the call was triggered. Element 0 is the AnnotationNode that triggered this
annotation to be activated. Element 1 is the AnnotatedNode decorated, such as a MethodNode or ClassNode. For
global transformations it is usually safe to ignore this parameter.source
- The source unit being compiled. The source unit may contain several classes. For global transformations,
information about the AST can be retrieved from this object.public void visitAnnotations(AnnotatedNode node)
visitAnnotations
in class ClassCodeVisitorSupport
node
- the AST node we are processing