Package: org.apache.groovy.contracts.classgen.asm

## [Java] Class ContractClosureWriter

- org.apache.groovy.contracts.classgen.asm.ContractClosureWriter

-     public class ContractClosureWriter
      extends Object

  Replaces annotation closures with closure implementation classes.

  Attention: large parts of this class have been backported from Groovy 1.8 and customized for usage in groovy-contracts.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public ClassNode` | `createClosureClass(ClassNode classNode, MethodNode methodNode, ClosureExpression expression, boolean addOldVariable, boolean addResultVariable, int mods)` Generates a synthetic closure implementation class for the supplied contract closure.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public ClassNode createClosureClass(ClassNode classNode, MethodNode methodNode, ClosureExpression expression, boolean addOldVariable, boolean addResultVariable, int mods)

      Generates a synthetic closure implementation class for the supplied contract closure.

      Parameters:
        `classNode` - the declaring class
        `methodNode` - the owning method or constructor, or `null` for class invariants
        `expression` - the rewritten closure body
        `addOldVariable` - whether to expose the `old` map parameter
        `addResultVariable` - whether to expose the `result` parameter
        `mods` - the access modifiers to apply to the generated class
      Returns:
        the generated closure implementation class