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 Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
protected final ReaderSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected BooleanExpression
addCallsToSuperMethodNodeAnnotationClosure
(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition) protected BlockStatement
getInlineModeBlockStatement
(BlockStatement blockStatement) static String
getInvariantMethodName
(ClassNode classNode) static MethodNode
getInvariantMethodNode
(ClassNode classNode) protected BlockStatement
wrapAssertionBooleanExpression
(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
- theClassNode
used to look up the invariant closure field- Returns:
- the field name of the invariant closure field of the given classNode
-
getInvariantMethodNode
- Parameters:
classNode
- theClassNode
used to look up the invariant closure field- Returns:
- the
MethodNode
which contains the invariant of the given classNode
-
getInlineModeBlockStatement
-
wrapAssertionBooleanExpression
protected BlockStatement wrapAssertionBooleanExpression(ClassNode type, MethodNode methodNode, BooleanExpression classInvariantExpression, String assertionType) -
addCallsToSuperMethodNodeAnnotationClosure
protected BooleanExpression addCallsToSuperMethodNodeAnnotationClosure(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition)
-