Package groovy.transform.options
Class DefaultPropertyHandler
java.lang.Object
groovy.transform.options.PropertyHandler
groovy.transform.options.DefaultPropertyHandler
Default implementation for validating and initializing transformed properties.
- Since:
- 2.5.0
-
Field Summary
Fields inherited from class groovy.transform.options.PropertyHandler
PROPERTY_OPTIONS_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePropInit(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, PropertyNode pNode, Parameter namedArgsMap) Create a statement that will initialize the property including any defensive copying.booleanvalidateAttributes(AbstractASTTransformation xform, AnnotationNode anno) Validates annotation attributes supported by this handler.booleanvalidateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, List<PropertyNode> props) Validates the properties selected for processing.Methods inherited from class groovy.transform.options.PropertyHandler
createPropertyHandler, createPropGetter, createPropSetter, isValidAttribute
-
Constructor Details
-
DefaultPropertyHandler
public DefaultPropertyHandler()
-
-
Method Details
-
validateAttributes
Validates annotation attributes supported by this handler.- Specified by:
validateAttributesin classPropertyHandler- Parameters:
xform- the active transformanno- the property options annotation- Returns:
trueif validation succeeds
-
validateProperties
public boolean validateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, List<PropertyNode> props) Validates the properties selected for processing.- Overrides:
validatePropertiesin classPropertyHandler- Parameters:
xform- the active transformbody- the statement block being generatedcNode- the owning classprops- the candidate properties- Returns:
trueif validation succeeds
-
createPropInit
public Statement createPropInit(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, PropertyNode pNode, Parameter namedArgsMap) Create a statement that will initialize the property including any defensive copying. Null if no statement should be added.- Specified by:
createPropInitin classPropertyHandler- Parameters:
xform- the transform being processedanno- the '@ImmutableBase' annotation nodecNode- the classnode containing the propertypNode- the property node to initializenamedArgsMap- an "args" Map if the property value should come from a named arg map or null if not
-