groovy / 4.0 / org / apache / groovy / contracts / ast / gcontractsasttransformation.html

[Java] Class GContractsASTTransformation

  • org.apache.groovy.contracts.ast.GContractsASTTransformation
@GroovyASTTransformation(phase = CompilePhase.INSTRUCTION_SELECTION)
public class GContractsASTTransformation
extends BaseASTTransformation

Custom AST transformation that removes closure annotations of Invariant, Requires and Ensures and adds Java assertions executing the closure-code.

Whenever an assertion is broken an AssertionViolation descendant class will be thrown.

See Also:
PreconditionViolation
PostconditionViolation
ClassInvariantViolation

Methods Summary

Methods
Type Params Return Type Name and description
public void visit(ASTNode[] nodes, SourceUnit unit)
ASTTransformation.visit

Inherited Methods Summary

Inherited Methods
Methods inherited from class Name
class BaseASTTransformation getReaderSource

Method Detail

@Override public void visit(ASTNode[] nodes, SourceUnit unit)

ASTTransformation.visit

© 2003-2022 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/4.0.0/html/gapi/org/apache/groovy/contracts/ast/GContractsASTTransformation.html