# Package org.apache.groovy.contracts.generation

package org.apache.groovy.contracts.generation
Code generation and transformation utilities for producing runtime contract validation code.

- Related Packages
  Package
  Description
  org.apache.groovy.contracts
  Provides Design by Contract (DbC) support for Groovy classes and methods.
  org.apache.groovy.contracts.ast
  AST transformations for implementing Design by Contract semantics, including precondition, postcondition, and invariant validation transformations.
  org.apache.groovy.contracts.domain
  Domain model classes representing contract elements such as preconditions, postconditions, and class invariants.
  org.apache.groovy.contracts.util
  Utility functions and helper classes for contract processing and validation.
- Classes
  Class
  Description
  AssertStatementCreationUtility
  Central place to create `AssertStatement` instances in groovy-contracts.
  AssertStatementCreationUtility.AddAssertionCallStatementToReturnStatementVisitor
  Replaces a given `ReturnStatement` with the appropriate assertion call statement and returns a result variable expression.
  AssertStatementCreationUtility.AddResultReturnStatementVisitor
  Replaces a given `ReturnStatement` with the appropriate assertion call statement and returns a result variable expression.
  AssertStatementCreationUtility.ReturnStatementVisitor
  Collects all `ReturnStatement` instances from a given code block.
  BaseGenerator
  Base class for groovy-contracts code generators.
  CandidateChecks
  Functions in this class are used to determine whether a certain AST node fulfills certain assertion requirements.
  ClassInvariantGenerator
  Code generator for class invariants.
  Configurator
  Handles `-ea` and `-da` runtime input arguments for enabling and disabling contract elements.
  ContractExecutionTracker
  Keeps track of contract executions to avoid cyclic contract checks.
  ContractExecutionTracker.ContractExecution
  Identifies one contract execution so recursive re-entry can be suppressed.
  OldVariableGenerationUtility
  Central place where code generation for the `old` closure variable takes place.
  PostconditionGenerator
  Code generator for postconditions.
  PreconditionGenerator
  Code generator for preconditions.
  TryCatchBlockGenerator
  Creates a try-catch block around a given `AssertStatement` and catches a PowerAssertionError to reuse the generated visual output.