public class PreconditionGenerator extends BaseGenerator
Code generator for preconditions.
Fields inherited from class | Fields |
---|---|
class BaseGenerator |
INVARIANT_CLOSURE_PREFIX, META_DATA_USE_INLINE_MODE, source |
Constructor and description |
---|
PreconditionGenerator(ReaderSource source) |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
generateDefaultPreconditionStatement(ClassNode type, MethodNode methodNode) Generates the default precondition statement for MethodNode instances with the Precondition annotation. |
|
public void |
generatePreconditionAssertionStatement(MethodNode method, Precondition precondition) Injects a precondition assertion statement in the given method, based on the given annotation of type Requires. |
Methods inherited from class | Name |
---|---|
class BaseGenerator |
addCallsToSuperMethodNodeAnnotationClosure, getInlineModeBlockStatement, getInvariantMethodName, getInvariantMethodNode, wrapAssertionBooleanExpression |
Generates the default precondition statement for MethodNode instances with the Precondition annotation.
type
- the current ClassNodemethodNode
- the MethodNode with a Precondition annotationInjects a precondition assertion statement in the given method, based on the given annotation of type Requires.
method
- the MethodNode for assertion injectionprecondition
- the Precondition the assertion statement should be generated fromCopyright © 2003-2024 The Apache Software Foundation. All rights reserved.