Class PreconditionGenerator
java.lang.Object
org.apache.groovy.contracts.generation.BaseGenerator
org.apache.groovy.contracts.generation.PreconditionGenerator
Code generator for preconditions.
- 
Field SummaryFields inherited from class org.apache.groovy.contracts.generation.BaseGeneratorINVARIANT_CLOSURE_PREFIX, META_DATA_USE_INLINE_MODE, source
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidgenerateDefaultPreconditionStatement(ClassNode type, MethodNode methodNode) Generates the default precondition statement forMethodNodeinstances with thePreconditionannotation.voidgeneratePreconditionAssertionStatement(MethodNode method, Precondition precondition) Injects a precondition assertion statement in the given method, based on the given annotation of typeRequires.Methods inherited from class org.apache.groovy.contracts.generation.BaseGeneratoraddCallsToSuperMethodNodeAnnotationClosure, getInlineModeBlockStatement, getInvariantMethodName, getInvariantMethodNode, wrapAssertionBooleanExpression
- 
Constructor Details- 
PreconditionGenerator
 
- 
- 
Method Details- 
generatePreconditionAssertionStatementInjects a precondition assertion statement in the given method, based on the given annotation of typeRequires.- Parameters:
- method- the- MethodNodefor assertion injection
- precondition- the- Preconditionthe assertion statement should be generated from
 
- 
generateDefaultPreconditionStatementGenerates the default precondition statement forMethodNodeinstances with thePreconditionannotation.- Parameters:
- type- the current- ClassNode
- methodNode- the- MethodNodewith a- Preconditionannotation
 
 
-