Package groovy.lang
Class MetaProperty
- java.lang.Object
-
- groovy.lang.MetaProperty
-
- Direct Known Subclasses:
CachedField,MetaArrayLengthProperty,MetaBeanProperty,MetaExpandoProperty
public abstract class MetaProperty extends java.lang.ObjectRepresents a property on a bean which may have a getter and/or a setter- Version:
- $Revision$
- Author:
- James Strachan
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringnamestatic java.lang.StringPROPERTY_SET_PREFIXprotected java.lang.Classtype
-
Constructor Summary
Constructors Constructor Description MetaProperty(java.lang.String name, java.lang.Class type)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetGetterName(java.lang.String propertyName, java.lang.Class type)intgetModifiers()java.lang.StringgetName()abstract java.lang.ObjectgetProperty(java.lang.Object object)static java.lang.StringgetSetterName(java.lang.String propertyName)java.lang.ClassgetType()abstract voidsetProperty(java.lang.Object object, java.lang.Object newValue)Sets the property on the given object to the new value
-
-
-
Field Detail
-
name
protected final java.lang.String name
-
type
protected java.lang.Class type
-
PROPERTY_SET_PREFIX
public static final java.lang.String PROPERTY_SET_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProperty
public abstract java.lang.Object getProperty(java.lang.Object object)
- Returns:
- the property of the given object
- Throws:
java.lang.Exception- if the property could not be evaluated
-
setProperty
public abstract void setProperty(java.lang.Object object, java.lang.Object newValue)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:
java.lang.RuntimeException- if the property could not be set
-
getName
public java.lang.String getName()
-
getType
public java.lang.Class getType()
- Returns:
- the type of the property
-
getModifiers
public int getModifiers()
-
getGetterName
public static java.lang.String getGetterName(java.lang.String propertyName, java.lang.Class type)
-
getSetterName
public static java.lang.String getSetterName(java.lang.String propertyName)
-
-