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 String
getGetterName
(String propertyName, Class type) int
getName()
abstract Object
getProperty
(Object object) static String
getSetterName
(String propertyName) getType()
abstract void
setProperty
(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
-