All Classes and Interfaces
Class
Description
Visits interfaces & classes and looks for @Requires or @Ensures and creates
Closure
classes for the annotation closures.This
BaseVisitor walks up the class hierarchy for the given ClassNode
and adds ContractElement annotations to method parameters.Base class for modifying the internal domain model, starting at
Contract, and adding parts to it.Indicates what
AnnotationProcessor implementation should be used to process
the correlating annotation.Visits annotations of meta-type
ContractElement and applies the AST transformations of the underlying
AnnotationProcessor implementation.Helper methods for reading/getting
AnnotationNode instances.Base class for all assertion types.
Abstract base class for all assertion violations.
Central place to create
AssertStatement instances in groovy-contracts.Replaces a given
ReturnStatement with the appropriate assertion call statement and returns a result variable expression.Replaces a given
ReturnStatement with the appropriate assertion call statement and returns a result variable expression.Collects all
ReturnStatement instances from a given code block.Holds all constants to be used as AST node metadata keys.
Base AST transformation encapsulating all common helper methods and implementing
ASTTransformation.Base class for groovy-contracts code generators.
Base implementation class for interface
Lifecycle.
Base class for
ClassCodeVisitorSupport descendants.
Functions in this class are used to determine whether a certain AST node fulfills certain assertion
requirements.
Thrown whenever pre- or post-conditions are called in a cyclic way.
Indicates that annotations being marked as
@ClassInvariant are to be treated
as class invariant modifying annotations.A class-invariant assertion.
Internal
AnnotationProcessor implementation for class-invariants.
Code generator for class invariants.
Internal
Lifecycle implementation for class-invariants.Thrown whenever a class invariant violation occurs.
Evaluates
ClosureExpression instances in as actual annotation parameters and
generates special contract closure classes from them.Makes some initialization in order to use the
Configurator for determining
which assertions in what packages will be executed.Handles
-ea and -da runtime input arguments for enabling and
disabling contract elements.Represents a contract between a supplier and a customer of a class.
Replaces annotation closures with closure implementation classes.
Package-level and class-level annotation indicating that the package is enabled for
class-invariants, pre- and post-conditions.
Indicates that annotations being marked as
@ContractElement are to be used
by some contract element being either a class-invariant, pre- or post-condition.Checks whether the given
ClassNode is relevant for
further processing.Keeps track of contract executions to avoid cyclic contract checks.
Visits the given
ClassNode and injects the current Contract into the given AST
nodes.
Implements contract support for setter methods and default constructors of POGOs.
Represents a method postcondition.
Internal
AnnotationProcessor implementation for post-conditions.Internal utility class for extracting a boolean expression from the given expression or statement.
This utility is meant to be used to replace direct calls to private
field variables in class invariants.
Represents a class-invariant.
Specifies life-cycle hook-ins for applying AST transformation logic before and
after the annotation processors have been run.
AST transformation visitor which is triggered after applying
AnnotationProcessor
related transformations.AST transformation visitor which is triggered before applying
AnnotationProcessor
related transformations.Finds and loads implementation classes of interface
Lifecycle.Central place where code generation for the old closure variable
takes place.
Indicates that annotations being marked as
@Postcondition are to be treated
as post-condition modifying annotations.A post-condition assertion.
Code generator for postconditions.
Internal
Lifecycle implementation for post-conditions.Thrown whenever a postcondition violation occurs.
Indicates that annotations being marked as
@Precondition are to be treated
as pre-condition modifying annotations.A pre-condition assertion.
Code generator for preconditions.
Internal
Lifecycle implementation for pre-conditions.Thrown whenever a precondition violation occurs.
Holds all context-specific information which is needed during the transformation
phase of a single
Contract and its related ClassNode.
Represents a method precondition.
Internal
AnnotationProcessor implementation for pre-conditions.Creates a try-catch block around a given
AssertStatement and catches
a PowerAssertionError to reuse the generated visual output.Internal utility class for in-code assertion checks.
A violation tracker is used to keep a list of pre-, post-condition or class-invariant
violations in chronological order.