[Java] Class CategoryASTTransformation
- org.codehaus.groovy.transform.CategoryASTTransformation
- All Implemented Interfaces and Traits:
- ASTTransformation, org.objectweb.asm.Opcodes
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION) public class CategoryASTTransformation extends Object implements ASTTransformation, org.objectweb.asm.Opcodes
Handles generation of code for the
- Category:
- annotation.
Transformation logic is as follows:
- all non-static methods converted to static ones with an additional 'self' parameter
- references to 'this' changed to the additional 'self' parameter
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
protected SourceUnit |
getSourceUnit() | |
public Expression |
transform(Expression exp) | |
public void |
visit(ASTNode[] nodes, SourceUnit source) Property invocations done on 'this' reference are transformed so that the invocations at runtime are done on the additional parameter 'self' | |
public void |
visitBlockStatement(BlockStatement block) | |
public void |
visitCatchStatement(CatchStatement statement) | |
public void |
visitClosureExpression(ClosureExpression ce) | |
public void |
visitDeclarationExpression(DeclarationExpression expression) | |
public void |
visitExpressionStatement(ExpressionStatement es) | |
public void |
visitForLoop(ForStatement forLoop) | |
public void |
visitMethod(MethodNode node) |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail
protected SourceUnit getSourceUnit()
@Override public Expression transform(Expression exp)
public void visit(ASTNode[] nodes, SourceUnit source)
Property invocations done on 'this' reference are transformed so that the invocations at runtime are done on the additional parameter 'self'
@Override public void visitBlockStatement(BlockStatement block)
@Override public void visitCatchStatement(CatchStatement statement)
@Override public void visitClosureExpression(ClosureExpression ce)
@Override public void visitDeclarationExpression(DeclarationExpression expression)
@Override public void visitExpressionStatement(ExpressionStatement es)
@Override public void visitForLoop(ForStatement forLoop)
@Override public void visitMethod(MethodNode node)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/transform/CategoryASTTransformation.html