public class DomainModelInjectionVisitor
extends BaseVisitor
Visits the given ClassNode and injects the current Contract into the given AST nodes.
| Fields inherited from class | Fields |
|---|---|
class BaseVisitor |
GCONTRACTS_ENABLED_VAR, sourceUnit |
| Constructor and description |
|---|
DomainModelInjectionVisitor(SourceUnit sourceUnit, ReaderSource source, ProcessingContextInformation pci)Creates a visitor that materializes the accumulated contract domain model back into AST nodes. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
injectClassInvariant(ClassNode type, ClassInvariant classInvariant)Generates AST support for the supplied class invariant. |
|
public void |
injectPostcondition(MethodNode method, Postcondition postcondition)Generates AST support for the supplied postcondition. |
|
public void |
injectPrecondition(MethodNode method, Precondition precondition)Generates AST support for the supplied precondition. |
|
public void |
visitClass(ClassNode type)Injects all contract elements currently present in the domain model into the supplied class. |
Creates a visitor that materializes the accumulated contract domain model back into AST nodes.
sourceUnit - the source unit currently being transformedsource - the reader source backing the source unitpci - per-class processing context shared across the contracts pipelineGenerates AST support for the supplied class invariant.
type - the class that should receive the invariantclassInvariant - the invariant to injectGenerates AST support for the supplied postcondition.
method - the method that should receive the postconditionpostcondition - the postcondition to injectGenerates AST support for the supplied precondition.
method - the method that should receive the preconditionprecondition - the precondition to injectInjects all contract elements currently present in the domain model into the supplied class.
type - the class to updateCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.