Class BaseGenerator
java.lang.Object
org.apache.groovy.contracts.generation.BaseGenerator
- Direct Known Subclasses:
- ClassInvariantGenerator,- PostconditionGenerator,- PreconditionGenerator
Base class for groovy-contracts code generators.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected final ReaderSource
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected BooleanExpressionaddCallsToSuperMethodNodeAnnotationClosure(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition) protected BlockStatementgetInlineModeBlockStatement(BlockStatement blockStatement) static StringgetInvariantMethodName(ClassNode classNode) static MethodNodegetInvariantMethodNode(ClassNode classNode) protected BlockStatementwrapAssertionBooleanExpression(ClassNode type, MethodNode methodNode, BooleanExpression classInvariantExpression, String assertionType) 
- 
Field Details- 
INVARIANT_CLOSURE_PREFIX- See Also:
 
- 
META_DATA_USE_INLINE_MODE- See Also:
 
- 
source
 
- 
- 
Constructor Details- 
BaseGenerator
 
- 
- 
Method Details- 
getInvariantMethodName- Parameters:
- classNode- the- ClassNodeused to look up the invariant closure field
- Returns:
- the field name of the invariant closure field of the given classNode
 
- 
getInvariantMethodNode- Parameters:
- classNode- the- ClassNodeused to look up the invariant closure field
- Returns:
- the MethodNodewhich contains the invariant of the given classNode
 
- 
getInlineModeBlockStatement
- 
wrapAssertionBooleanExpressionprotected BlockStatement wrapAssertionBooleanExpression(ClassNode type, MethodNode methodNode, BooleanExpression classInvariantExpression, String assertionType) 
- 
addCallsToSuperMethodNodeAnnotationClosureprotected BooleanExpression addCallsToSuperMethodNodeAnnotationClosure(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition) 
 
-