Package groovy.lang
Class MetaProperty
java.lang.Object
groovy.lang.MetaProperty
- Direct Known Subclasses:
CachedField,MetaArrayLengthProperty,MetaBeanProperty,MetaExpandoProperty
Represents a property on a bean which may have a getter and/or a setter
- Version:
- $Revision$
- Author:
- James Strachan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetGetterName(String propertyName, Class type) intgetName()abstract ObjectgetProperty(Object object) static StringgetSetterName(String propertyName) 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
- Returns:
- the property of the given object
- Throws:
Exception- if the property could not be evaluated
-
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() -
getGetterName
-
getSetterName
-