Package: org.apache.groovy.contracts.common.spi

## [Java] Interface Lifecycle

-     public interface Lifecycle

  Specifies life-cycle hook-ins for applying AST transformation logic before and after the annotation processors have been run.

  During execution of GContracts AST transformations, the following process is applied on each ClassNode instance which qualifies for contract annotations:

  1. Generation of closure classes.
  2. Handling of AnnotationProcessor implementation classes
  3. Domain Model Conversion and Injection

  ### Generation of closure classes

  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.

  ### Handling of AnnotationProcessor implementation classes

  AnnotationProcessor implementations 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.

  ### Domain Model Conversion and Injection

  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.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `afterProcessingClassNode(ProcessingContextInformation processingContextInformation, ClassNode classNode)` Runs after class-level processing and domain-model injection are complete.
    `` | `public void` | `afterProcessingConstructorNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode constructorNode)` Runs after constructor-level processing and domain-model injection are complete.
    `` | `public void` | `afterProcessingMethodNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode)` Runs after method-level processing and domain-model injection are complete.
    `` | `public void` | `beforeProcessingClassNode(ProcessingContextInformation processingContextInformation, ClassNode classNode)` Runs before class-level annotation processors are applied.
    `` | `public void` | `beforeProcessingConstructorNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode constructorNode)` Runs before constructor-level annotation processors are applied.
    `` | `public void` | `beforeProcessingMethodNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode)` Runs before method-level annotation processors are applied.

- - ### Method Detail

    - #### public void afterProcessingClassNode(ProcessingContextInformation processingContextInformation, ClassNode classNode)

      Runs after class-level processing and domain-model injection are complete.

      Parameters:
        `processingContextInformation` - the current processing context
        `classNode` - the processed class

    - #### public void afterProcessingConstructorNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode constructorNode)

      Runs after constructor-level processing and domain-model injection are complete.

      Parameters:
        `processingContextInformation` - the current processing context
        `classNode` - the declaring class
        `constructorNode` - the processed constructor

    - #### public void afterProcessingMethodNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode)

      Runs after method-level processing and domain-model injection are complete.

      Parameters:
        `processingContextInformation` - the current processing context
        `classNode` - the declaring class
        `methodNode` - the processed method

    - #### public void beforeProcessingClassNode(ProcessingContextInformation processingContextInformation, ClassNode classNode)

      Runs before class-level annotation processors are applied.

      Parameters:
        `processingContextInformation` - the current processing context
        `classNode` - the class about to be processed

    - #### public void beforeProcessingConstructorNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode constructorNode)

      Runs before constructor-level annotation processors are applied.

      Parameters:
        `processingContextInformation` - the current processing context
        `classNode` - the declaring class
        `constructorNode` - the constructor about to be processed

    - #### public void beforeProcessingMethodNode(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode)

      Runs before method-level annotation processors are applied.

      Parameters:
        `processingContextInformation` - the current processing context
        `classNode` - the declaring class
        `methodNode` - the method about to be processed