Class MetaProperty
java.lang.Object
groovy.lang.MetaProperty
- Direct Known Subclasses:
CachedField, MetaArrayLengthProperty, MetaBeanProperty, MetaExpandoProperty, MethodMetaProperty, MultipleSetterProperty
Represents a property on a bean which may have a getter and/or a setter
- Author:
- James Strachan
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetaProperty(String name, Class type) Constructor that sets the property name and type (class) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetGetterName(String propertyName, Class type) Gets the name for the getter for this propertyintReturns the access modifier.getName()Return the name of the propertyabstract ObjectgetProperty(Object object) static StringgetSetterName(String propertyName) Gets the setter for the getter for this property.getType()abstract voidsetProperty(Object object, Object newValue) Sets the property on the given object to the new value
-
Field Details
-
name
-
type
-
PROPERTY_SET_PREFIX
- See Also:
-
-
Constructor Details
-
MetaProperty
-
-
Method Details
-
getProperty
-
setProperty
Sets the property on the given object to the new value- Parameters:
object- on which to set the propertynewValue- the new value of the property- Throws:
RuntimeException- if the property could not be set
-
getName
-
getType
- Returns:
- the type of the property
-
getModifiers
public int getModifiers()Returns the access modifier.- Returns:
- Modifier.PUBLIC
-
getGetterName
-
getSetterName
-