@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 |
Class node for PropertyOptions. |
| 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)Creates the property handler configured for the supplied class. |
|
protected boolean |
isValidAttribute(AbstractASTTransformation xform, AnnotationNode anno, String memberName)Checks whether the named annotation attribute is unsupported for this handler. |
|
public abstract boolean |
validateAttributes(AbstractASTTransformation xform, AnnotationNode anno)Validates annotation attributes supported by this handler. |
|
public boolean |
validateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, List<PropertyNode> props)Validates the properties selected for processing. |
Class node for PropertyOptions.
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 nodeCreates the property handler configured for the supplied class.
xform - the active transformloader - the class loader used to instantiate custom handlerscNode - the class being transformednull if one could not be createdChecks whether the named annotation attribute is unsupported for this handler.
xform - the active transformanno - the annotation being processedmemberName - the attribute name to validatetrue if the attribute is valid for this handlerValidates annotation attributes supported by this handler.
xform - the active transformanno - the property options annotationtrue if validation succeedsValidates the properties selected for processing.
xform - the active transformbody - the statement block being generatedcNode - the owning classprops - the candidate propertiestrue if validation succeeds