Package org.apache.groovy.contracts.generation

# Class BaseGenerator

java.lang.Object
org.apache.groovy.contracts.generation.BaseGenerator

Direct Known Subclasses:
  `ClassInvariantGenerator`, `PostconditionGenerator`, `PreconditionGenerator`

public abstract class BaseGenerator extends Object
Base class for groovy-contracts code generators.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `INVARIANT_CLOSURE_PREFIX`
  `static final String`
  `META_DATA_USE_INLINE_MODE`
  `protected final ReaderSource`
  `source`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `BaseGenerator(ReaderSource source)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected BooleanExpression`
  `addCallsToSuperMethodNodeAnnotationClosure(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition)`
  `protected BlockStatement`
  `getInlineModeBlockStatement(BlockStatement blockStatement)`
  `static String`
  `getInvariantMethodName(ClassNode classNode)`
  `static MethodNode`
  `getInvariantMethodNode(ClassNode classNode)`
  `protected BlockStatement`
  `wrapAssertionBooleanExpression(ClassNode type, MethodNode methodNode, BooleanExpression classInvariantExpression, String assertionType)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### INVARIANT_CLOSURE_PREFIX

    public static final String INVARIANT_CLOSURE_PREFIX
    See Also:
      - Constant Field Values

  - ### META_DATA_USE_INLINE_MODE

    public static final String META_DATA_USE_INLINE_MODE
    See Also:
      - Constant Field Values

  - ### source

    protected final ReaderSource source

- ## Constructor Details

  - ### BaseGenerator

    protected BaseGenerator(ReaderSource source)

- ## Method Details

  - ### getInvariantMethodName

    public static String getInvariantMethodName(ClassNode classNode)
    Parameters:
      `classNode` - the `ClassNode` used to look up the invariant closure field
    Returns:
      the field name of the invariant closure field of the given `classNode`

  - ### getInvariantMethodNode

    public static MethodNode getInvariantMethodNode(ClassNode classNode)
    Parameters:
      `classNode` - the `ClassNode` used to look up the invariant closure field
    Returns:
      the `MethodNode` which contains the invariant of the given `classNode`

  - ### getInlineModeBlockStatement

    protected BlockStatement getInlineModeBlockStatement(BlockStatement blockStatement)

  - ### wrapAssertionBooleanExpression

    protected BlockStatement wrapAssertionBooleanExpression(ClassNode type, MethodNode methodNode, BooleanExpression classInvariantExpression, String assertionType)

  - ### addCallsToSuperMethodNodeAnnotationClosure

    protected BooleanExpression addCallsToSuperMethodNodeAnnotationClosure(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition)