Package groovy.lang
Class MetaProperty
- java.lang.Object
- 
- groovy.lang.MetaProperty
 
- 
- Direct Known Subclasses:
- CachedField,- MetaArrayLengthProperty,- MetaBeanProperty,- MetaExpandoProperty,- MethodMetaProperty,- MultipleSetterProperty
 
 public abstract class MetaProperty extends Object Represents a property on a bean which may have a getter and/or a setter
- 
- 
Constructor SummaryConstructors Constructor Description MetaProperty(String name, Class type)Constructor that sets the property name and type (class)
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static StringgetGetterName(String propertyName, Class type)Gets the name for the getter for this propertyintgetModifiers()Returns the access modifier.StringgetName()Return the name of the propertyabstract ObjectgetProperty(Object object)static StringgetSetterName(String propertyName)Gets the setter for the getter for this property.ClassgetType()abstract voidsetProperty(Object object, Object newValue)Sets the property on the given object to the new value
 
- 
- 
- 
Field Detail- 
nameprotected final String name 
 - 
typeprotected Class type 
 - 
PROPERTY_SET_PREFIXpublic static final String PROPERTY_SET_PREFIX - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getPropertypublic abstract Object getProperty(Object object) - Returns:
- the property of the given object
- Throws:
- Exception- if the property could not be evaluated
 
 - 
setPropertypublic abstract void setProperty(Object object, Object newValue) Sets the property on the given object to the new value- Parameters:
- object- on which to set the property
- newValue- the new value of the property
- Throws:
- RuntimeException- if the property could not be set
 
 - 
getNamepublic String getName() Return the name of the property- Returns:
- the name of the property
 
 - 
getTypepublic Class getType() - Returns:
- the type of the property
 
 - 
getModifierspublic int getModifiers() Returns the access modifier.- Returns:
- Modifier.PUBLIC
 
 - 
getGetterNamepublic static String getGetterName(String propertyName, Class type) Gets the name for the getter for this property- Returns:
- The name of the property. The name is "get"+ the capitalized propertyName or, in the case of boolean values, "is" + the capitalized propertyName
 
 
- 
 
-