public class ClassInvariantGenerator extends BaseGenerator
Code generator for class invariants.
Fields inherited from class | Fields |
---|---|
class BaseGenerator |
INVARIANT_CLOSURE_PREFIX, META_DATA_USE_INLINE_MODE, source |
Constructor and description |
---|
ClassInvariantGenerator(ReaderSource source) |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addInvariantAssertionStatement(ClassNode type, MethodNode method) Adds the current class-invariant to the given method. |
|
public void |
generateInvariantAssertionStatement(ClassNode type, ClassInvariant classInvariant) Reads the Invariant boolean expression and generates a synthetic method holding this class invariant. |
Methods inherited from class | Name |
---|---|
class BaseGenerator |
addCallsToSuperMethodNodeAnnotationClosure, getInlineModeBlockStatement, getInvariantMethodName, getInvariantMethodNode, wrapAssertionBooleanExpression |
Adds the current class-invariant to the given method.
type
- the ClassNode which declared the given MethodNodemethod
- the current MethodNodeReads the Invariant boolean expression and generates a synthetic method holding this class invariant. This is used for heir calls to find out about inherited class invariants.
type
- the current ClassNodeclassInvariant
- the ClassInvariant the assertion statement should be generated fromCopyright © 2003-2022 The Apache Software Foundation. All rights reserved.