Class MultipleSetterProperty
java.lang.Object
groovy.lang.MetaProperty
org.codehaus.groovy.runtime.metaclass.MultipleSetterProperty
- All Implemented Interfaces:
MetaMember
This class represents a property with multiple setters. Unlike a MetaBeanProperty you cannot get the setter
in this case. Instead invocation is done through the metaclass of the property receiver.
-
Field Summary
Fields inherited from class groovy.lang.MetaProperty
name, PROPERTY_SET_PREFIX, type -
Constructor Summary
ConstructorsConstructorDescriptionMultipleSetterProperty(String name) Constructs a new MultipleSetterProperty. -
Method Summary
Modifier and TypeMethodDescriptionCreates a static version of this property.getField()Gets the cached field for this property.Gets the getter method for this property.getProperty(Object object) voidSets the cached field for this property.voidsetGetter(MetaMethod getter) Sets the getter method for this property.voidsetProperty(Object object, Object newValue) Sets the property on the given object to the new value.Methods inherited from class groovy.lang.MetaProperty
getGetterName, getModifiers, getName, getSetterName, getTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface groovy.lang.MetaMember
isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic
-
Constructor Details
-
MultipleSetterProperty
Constructs a new MultipleSetterProperty.- Parameters:
name- the property name
-
-
Method Details
-
getProperty
- Specified by:
getPropertyin classMetaProperty- Returns:
- the property of the given object
-
setProperty
Description copied from class:MetaPropertySets the property on the given object to the new value.- Specified by:
setPropertyin classMetaProperty- Parameters:
object- on which to set the propertynewValue- the new value of the property
-
setField
Sets the cached field for this property.- Parameters:
f- the cached field
-
getField
Gets the cached field for this property.- Returns:
- the cached field
-
setGetter
Sets the getter method for this property.- Parameters:
getter- the getter metamethod
-
getGetter
Gets the getter method for this property.- Returns:
- the getter metamethod
-
createStaticVersion
Creates a static version of this property. Returns null if both the field and getter are instance methods.- Returns:
- a static version of this property, or this if already static, or null if no static version possible
-