Class PostconditionGenerator
java.lang.Object
org.apache.groovy.contracts.generation.BaseGenerator
org.apache.groovy.contracts.generation.PostconditionGenerator
Code generator for postconditions.
- 
Field SummaryFields inherited from class org.apache.groovy.contracts.generation.BaseGeneratorINVARIANT_CLOSURE_PREFIX, META_DATA_USE_INLINE_MODE, source
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddOldVariablesMethod(ClassNode classNode) Adds a synthetic method to the given classNode which can be used to create a map of most instance variables found in this class.voidgenerateDefaultPostconditionStatement(ClassNode type, MethodNode method) Adds a default postcondition if a postcondition has already been defined for thisMethodNodein a super-class.voidgeneratePostconditionAssertionStatement(MethodNode method, Postcondition postcondition) Injects a postcondition assertion statement in the given method, based on the booleanExpression.Methods inherited from class org.apache.groovy.contracts.generation.BaseGeneratoraddCallsToSuperMethodNodeAnnotationClosure, getInlineModeBlockStatement, getInvariantMethodName, getInvariantMethodNode, wrapAssertionBooleanExpression
- 
Constructor Details- 
PostconditionGenerator
 
- 
- 
Method Details- 
addOldVariablesMethodAdds a synthetic method to the given classNode which can be used to create a map of most instance variables found in this class. Used for the old variable mechanism.- Parameters:
- classNode- the- ClassNodeto add the synthetic method to
 
- 
generatePostconditionAssertionStatementInjects a postcondition assertion statement in the given method, based on the booleanExpression.- Parameters:
- method- the- MethodNodefor assertion injection
- postcondition- the- Postconditionthe assertion statement should be generated from
 
- 
generateDefaultPostconditionStatementAdds a default postcondition if a postcondition has already been defined for thisMethodNodein a super-class.- Parameters:
- type- the current- ClassNodeof the given methodNode
- method- the- MethodNodeto create the default postcondition for
 
 
-