public class DynamicSetterInjectionVisitor
extends BaseVisitor
Implements contract support for setter methods and default constructors of POGOs.
| Fields inherited from class | Fields |
|---|---|
class BaseVisitor |
GCONTRACTS_ENABLED_VAR, sourceUnit |
| Constructor and description |
|---|
DynamicSetterInjectionVisitor(SourceUnit sourceUnit, ReaderSource source)Creates a visitor that injects synthetic setters and constructors needed for invariant checks. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected Statement |
createSetterBlock(ClassNode classNode, FieldNode field, Parameter parameter)Creates the body of a synthetic setter that wraps the assignment with invariant checks. |
|
public void |
visitClass(ClassNode classNode)Prepares invariant-check blocks for the class and adds a synthetic default constructor when needed. |
|
public void |
visitProperty(PropertyNode node)Adds a synthetic setter for invariant-checked properties when no explicit setter is present. |
Creates a visitor that injects synthetic setters and constructors needed for invariant checks.
sourceUnit - the source unit currently being transformedsource - the reader source backing the source unitCreates the body of a synthetic setter that wraps the assignment with invariant checks.
classNode - the declaring classfield - the field being writtenparameter - the synthetic setter parameterPrepares invariant-check blocks for the class and adds a synthetic default constructor when needed.
classNode - the class being visitedAdds a synthetic setter for invariant-checked properties when no explicit setter is present.
node - the property being visitedCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.