Package groovy.transform.options
Class ImmutablePropertyHandler
java.lang.Object
groovy.transform.options.PropertyHandler
groovy.transform.options.ImmutablePropertyHandler
- Direct Known Subclasses:
- LegacyHashMapPropertyHandler
public class ImmutablePropertyHandler extends PropertyHandler
- 
Field SummaryFields inherited from class groovy.transform.options.PropertyHandlerPROPERTY_OPTIONS_TYPE
- 
Constructor SummaryConstructors Constructor Description ImmutablePropertyHandler()
- 
Method SummaryModifier and Type Method Description protected StatementcheckFinalArgNotOverridden(ClassNode cNode, FieldNode fNode)protected ExpressioncloneCollectionExpr(Expression fieldExpr, ClassNode type)protected ExpressioncreateAsImmutableX(Expression expr, ClassNode type)protected StatementcreateConstructorStatement(AbstractASTTransformation xform, ClassNode cNode, PropertyNode pNode, boolean namedArgs)Deprecated.protected StatementcreateConstructorStatement(AbstractASTTransformation xform, ClassNode cNode, PropertyNode pNode, Parameter namedArgsMap)StatementcreatePropGetter(PropertyNode pNode)Create the getter block used when reading the property including any defensive copying.StatementcreatePropInit(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, PropertyNode pNode, Parameter namedArgsMap)Create a statement that will initialize the property including any defensive copying.StatementcreatePropSetter(PropertyNode pNode)Create the setter block used when setting the property.booleanvalidateAttributes(AbstractASTTransformation xform, AnnotationNode anno)booleanvalidateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, java.util.List<PropertyNode> props)Methods inherited from class groovy.transform.options.PropertyHandlercreatePropertyHandler, isValidAttributeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Constructor Details- 
ImmutablePropertyHandlerpublic ImmutablePropertyHandler()
 
- 
- 
Method Details- 
createPropGetterDescription copied from class:PropertyHandlerCreate the getter block used when reading the property including any defensive copying.- Overrides:
- createPropGetterin class- PropertyHandler
- Parameters:
- pNode- the property node
 
- 
createPropSetterDescription copied from class:PropertyHandlerCreate the setter block used when setting the property. Can be null for read-only properties.- Overrides:
- createPropSetterin class- PropertyHandler
- Parameters:
- pNode- the property node
 
- 
validateAttributes- Specified by:
- validateAttributesin class- PropertyHandler
 
- 
validatePropertiespublic boolean validateProperties(AbstractASTTransformation xform, BlockStatement body, ClassNode cNode, java.util.List<PropertyNode> props)- Overrides:
- validatePropertiesin class- PropertyHandler
 
- 
createPropInitpublic Statement createPropInit(AbstractASTTransformation xform, AnnotationNode anno, ClassNode cNode, PropertyNode pNode, Parameter namedArgsMap)Description copied from class:PropertyHandlerCreate a statement that will initialize the property including any defensive copying. Null if no statement should be added.- Specified by:
- createPropInitin class- PropertyHandler
- Parameters:
- xform- the transform being processed
- anno- the '@ImmutableBase' annotation node
- cNode- the classnode containing the property
- pNode- the property node to initialize
- namedArgsMap- an "args" Map if the property value should come from a named arg map or null if not
 
- 
cloneCollectionExpr
- 
createAsImmutableX
- 
createConstructorStatement@Deprecated protected Statement createConstructorStatement(AbstractASTTransformation xform, ClassNode cNode, PropertyNode pNode, boolean namedArgs)Deprecated.
- 
createConstructorStatementprotected Statement createConstructorStatement(AbstractASTTransformation xform, ClassNode cNode, PropertyNode pNode, Parameter namedArgsMap)
- 
checkFinalArgNotOverridden
 
-