@Incubating public abstract class PropertyHandler extends Object
Used to provide custom property handling when getting, setting or initializing properties.
Modifiers | Name | Description |
---|---|---|
static ClassNode |
PROPERTY_OPTIONS_TYPE |
Type Params | Return Type | Name and description |
---|---|---|
|
public Statement |
createPropGetter(PropertyNode pNode) Create the getter block used when reading the property including any defensive copying. |
|
public abstract Statement |
createPropInit(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, PropertyNode pNode, Parameter namedArgMap) Create a statement that will initialize the property including any defensive copying. |
|
public Statement |
createPropSetter(PropertyNode pNode) Create the setter block used when setting the property. |
|
public static PropertyHandler |
createPropertyHandler(AbstractASTTransformation xform, GroovyClassLoader loader, ClassNode cNode) |
|
public abstract boolean |
validateAttributes(AbstractASTTransformation xform, AnnotationNode anno) |
|
public boolean |
validateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, List<PropertyNode> props) |
Create the getter block used when reading the property including any defensive copying.
pNode
- the property nodeCreate a statement that will initialize the property including any defensive copying. Null if no statement should be added.
xform
- the transform being processedanno
- the '@ImmutableBase' annotation nodecNode
- the classnode containing the propertypNode
- the property node to initializenamedArgMap
- an "args" Map if the property value should come from a named arg map or null if notCreate the setter block used when setting the property. Can be null for read-only properties.
pNode
- the property node