Package groovy.transform.options
Class PropertyHandler
- java.lang.Object
- 
- groovy.transform.options.PropertyHandler
 
- 
- Direct Known Subclasses:
- DefaultPropertyHandler,- ImmutablePropertyHandler
 
 @Incubating public abstract class PropertyHandler extends java.lang.Object Used to provide custom property handling when getting, setting or initializing properties.- Since:
- 2.5.0
 
- 
- 
Field SummaryFields Modifier and Type Field Description static ClassNodePROPERTY_OPTIONS_TYPE
 - 
Constructor SummaryConstructors Constructor Description PropertyHandler()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static PropertyHandlercreatePropertyHandler(AbstractASTTransformation xform, GroovyClassLoader loader, ClassNode cNode)StatementcreatePropGetter(PropertyNode pNode)Create the getter block used when reading the property including any defensive copying.abstract StatementcreatePropInit(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, PropertyNode pNode, Parameter namedArgMap)Create a statement that will initialize the property including any defensive copying.StatementcreatePropSetter(PropertyNode pNode)Create the setter block used when setting the property.protected booleanisValidAttribute(AbstractASTTransformation xform, AnnotationNode anno, java.lang.String memberName)abstract booleanvalidateAttributes(AbstractASTTransformation xform, AnnotationNode anno)booleanvalidateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, java.util.List<PropertyNode> props)
 
- 
- 
- 
Field Detail- 
PROPERTY_OPTIONS_TYPEpublic static final ClassNode PROPERTY_OPTIONS_TYPE 
 
- 
 - 
Method Detail- 
validateAttributespublic abstract boolean validateAttributes(AbstractASTTransformation xform, AnnotationNode anno) 
 - 
validatePropertiespublic boolean validateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, java.util.List<PropertyNode> props) 
 - 
createPropInitpublic 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. Null if no statement should be added.- Parameters:
- xform- the transform being processed
- anno- the '@ImmutableBase' annotation node
- cNode- the classnode containing the property
- pNode- the property node to initialize
- namedArgMap- an "args" Map if the property value should come from a named arg map or null if not
 
 - 
createPropGetterpublic Statement createPropGetter(PropertyNode pNode) Create the getter block used when reading the property including any defensive copying.- Parameters:
- pNode- the property node
 
 - 
createPropSetterpublic Statement createPropSetter(PropertyNode pNode) Create the setter block used when setting the property. Can be null for read-only properties.- Parameters:
- pNode- the property node
 
 - 
isValidAttributeprotected boolean isValidAttribute(AbstractASTTransformation xform, AnnotationNode anno, java.lang.String memberName) 
 - 
createPropertyHandlerpublic static PropertyHandler createPropertyHandler(AbstractASTTransformation xform, GroovyClassLoader loader, ClassNode cNode) 
 
- 
 
-