public interface Lifecycle
Specifies life-cycle hook-ins for applying AST transformation logic before and after the annotation processors have been run.
During excution of GContracts AST transformations, the following process is applied on each ClassNode instance which qualifies for contract annotations:
In order to support Groovy 1.7.x GContracts backported Groovy 1.8 handling of annotation closures. This is done by extracting ClosureExpression from annotations and creating Closure implementation classes.
AnnotationProcessor implementatios are used to modify domain classes found in org.apache.groovy.contracts.domain. For that reason, concrete annotation processor often don't modify AST nodes directly, but simply work with domain classes like Contract. Whenever an annotation processor is done, it has finished its work on the underlying domain model.
beforeProcessingClassNode(ProcessingContextInformation, org.codehaus.groovy.ast.ClassNode), beforeProcessingMethodNode(ProcessingContextInformation, org.codehaus.groovy.ast.ClassNode, org.codehaus.groovy.ast.MethodNode), beforeProcessingConstructorNode(ProcessingContextInformation, org.codehaus.groovy.ast.ClassNode, org.codehaus.groovy.ast.MethodNode) are fired before annotation processors are executed.
Takes a look at the domain model instances and generates the corresponding AST transformation code.
afterProcessingClassNode(ProcessingContextInformation, org.codehaus.groovy.ast.ClassNode), afterProcessingMethodNode(ProcessingContextInformation, org.codehaus.groovy.ast.ClassNode, org.codehaus.groovy.ast.MethodNode), afterProcessingConstructorNode(ProcessingContextInformation, org.codehaus.groovy.ast.ClassNode, org.codehaus.groovy.ast.MethodNode) are fired after domain model conversion and injection is done.
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
afterProcessingClassNode(ProcessingContextInformation processingContextInformation, ClassNode classNode) |
|
public void |
afterProcessingConstructorNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode constructorNode) |
|
public void |
afterProcessingMethodNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode) |
|
public void |
beforeProcessingClassNode(ProcessingContextInformation processingContextInformation, ClassNode classNode) |
|
public void |
beforeProcessingConstructorNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode constructorNode) |
|
public void |
beforeProcessingMethodNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode) |