Package org.apache.groovy.contracts.generation
package org.apache.groovy.contracts.generation
Code generation and transformation utilities for producing runtime contract validation code.
-
ClassesClassDescriptionCentral place to create
AssertStatementinstances in groovy-contracts.Replaces a givenReturnStatementwith the appropriate assertion call statement and returns a result variable expression.Replaces a givenReturnStatementwith the appropriate assertion call statement and returns a result variable expression.Collects allReturnStatementinstances from a given code block.Base class for groovy-contracts code generators.Functions in this class are used to determine whether a certain AST node fulfills certain assertion requirements.Code generator for class invariants.Handles-eaand-daruntime input arguments for enabling and disabling contract elements.Keeps track of contract executions to avoid cyclic contract checks.Identifies one contract execution so recursive re-entry can be suppressed.Central place where code generation for the old closure variable takes place.Code generator for postconditions.Code generator for preconditions.Creates a try-catch block around a givenAssertStatementand catches a PowerAssertionError to reuse the generated visual output.