groovy / 4.0 / org / apache / groovy / contracts / generation / basegenerator.html

[Java] Class BaseGenerator

  • org.apache.groovy.contracts.generation.BaseGenerator
public abstract class BaseGenerator
extends Object

Base class for groovy-contracts code generators.

Field Summary

Fields
Modifiers Name Description
static String INVARIANT_CLOSURE_PREFIX
static String META_DATA_USE_INLINE_MODE
protected ReaderSource source

Constructor Summary

Constructors
Constructor and description
protected BaseGenerator(ReaderSource source)

Methods Summary

Methods
Type Params Return Type Name and description
protected BooleanExpression addCallsToSuperMethodNodeAnnotationClosure(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition)
protected BlockStatement getInlineModeBlockStatement(BlockStatement blockStatement)
public static String getInvariantMethodName(ClassNode classNode)
Parameters:
classNode - the ClassNode used to look up the invariant closure field
public static MethodNode getInvariantMethodNode(ClassNode classNode)
Parameters:
classNode - the ClassNode used to look up the invariant closure field
protected BlockStatement wrapAssertionBooleanExpression(ClassNode type, MethodNode methodNode, BooleanExpression classInvariantExpression, String assertionType)

Inherited Methods Summary

Inherited Methods
Methods inherited from class Name
class Object wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Field Detail

public static final String INVARIANT_CLOSURE_PREFIX

public static final String META_DATA_USE_INLINE_MODE

protected final ReaderSource source

Constructor Detail

protected BaseGenerator(ReaderSource source)

Method Detail

protected BooleanExpression addCallsToSuperMethodNodeAnnotationClosure(ClassNode type, MethodNode methodNode, Class<? extends Annotation> annotationType, BooleanExpression booleanExpression, boolean isPostcondition)

protected BlockStatement getInlineModeBlockStatement(BlockStatement blockStatement)

public static String getInvariantMethodName(ClassNode classNode)

Parameters:
classNode - the ClassNode used to look up the invariant closure field
Returns:
the field name of the invariant closure field of the given classNode

public static MethodNode getInvariantMethodNode(ClassNode classNode)

Parameters:
classNode - the ClassNode used to look up the invariant closure field
Returns:
the MethodNode which contains the invariant of the given classNode

protected BlockStatement wrapAssertionBooleanExpression(ClassNode type, MethodNode methodNode, BooleanExpression classInvariantExpression, String assertionType)

© 2003-2022 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/4.0.0/html/gapi/org/apache/groovy/contracts/generation/BaseGenerator.html