@Incubating public abstract class PropertyHandler extends Object
Modifier and Type | Field and Description |
---|---|
static ClassNode |
PROPERTY_OPTIONS_TYPE |
Constructor and Description |
---|
PropertyHandler() |
Modifier and Type | Method and Description |
---|---|
static PropertyHandler |
createPropertyHandler(AbstractASTTransformation xform,
GroovyClassLoader loader,
ClassNode cNode) |
Statement |
createPropGetter(PropertyNode pNode)
Create the getter block used when reading the property including any defensive copying.
|
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.
|
Statement |
createPropSetter(PropertyNode pNode)
Create the setter block used when setting the property.
|
protected boolean |
isValidAttribute(AbstractASTTransformation xform,
AnnotationNode anno,
String memberName) |
abstract boolean |
validateAttributes(AbstractASTTransformation xform,
AnnotationNode anno) |
boolean |
validateProperties(AbstractASTTransformation xform,
BlockStatement body,
ClassNode cNode,
List<PropertyNode> props) |
public static final ClassNode PROPERTY_OPTIONS_TYPE
public abstract boolean validateAttributes(AbstractASTTransformation xform, AnnotationNode anno)
public boolean validateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, List<PropertyNode> props)
public abstract Statement createPropInit(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, PropertyNode pNode, Parameter namedArgMap)
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 notpublic Statement createPropGetter(PropertyNode pNode)
pNode
- the property nodepublic Statement createPropSetter(PropertyNode pNode)
pNode
- the property nodeprotected boolean isValidAttribute(AbstractASTTransformation xform, AnnotationNode anno, String memberName)
public static PropertyHandler createPropertyHandler(AbstractASTTransformation xform, GroovyClassLoader loader, ClassNode cNode)