Class ClassInvariantGenerator
java.lang.Object
org.apache.groovy.contracts.generation.BaseGenerator
org.apache.groovy.contracts.generation.ClassInvariantGenerator
Code generator for class invariants.
- 
Field SummaryFields inherited from class org.apache.groovy.contracts.generation.BaseGeneratorINVARIANT_CLOSURE_PREFIX, META_DATA_USE_INLINE_MODE, source
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInvariantAssertionStatement(ClassNode type, MethodNode method) Adds the current class-invariant to the given method.voidgenerateInvariantAssertionStatement(ClassNode type, ClassInvariant classInvariant) Reads theInvariantboolean expression and generates a synthetic method holding this class invariant.Methods inherited from class org.apache.groovy.contracts.generation.BaseGeneratoraddCallsToSuperMethodNodeAnnotationClosure, getInlineModeBlockStatement, getInvariantMethodName, getInvariantMethodNode, wrapAssertionBooleanExpression
- 
Constructor Details- 
ClassInvariantGenerator
 
- 
- 
Method Details- 
generateInvariantAssertionStatementReads theInvariantboolean expression and generates a synthetic method holding this class invariant. This is used for heir calls to find out about inherited class invariants.- Parameters:
- type- the current- ClassNode
- classInvariant- the- ClassInvariantthe assertion statement should be generated from
 
- 
addInvariantAssertionStatementAdds the current class-invariant to the given method.- Parameters:
- type- the- ClassNodewhich declared the given- MethodNode
- method- the current- MethodNode
 
 
-