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 java.lang.ObjectRepresents a property on a bean which may have a getter and/or a setter
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.Stringnamestatic java.lang.StringPROPERTY_SET_PREFIXprotected java.lang.Classtype
 - 
Constructor SummaryConstructors Constructor Description MetaProperty(java.lang.String name, java.lang.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 java.lang.StringgetGetterName(java.lang.String propertyName, java.lang.Class type)Gets the name for the getter for this propertyintgetModifiers()Returns the access modifier.java.lang.StringgetName()Return the name of the propertyabstract java.lang.ObjectgetProperty(java.lang.Object object)static java.lang.StringgetSetterName(java.lang.String propertyName)Gets the setter for the getter for this property.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- 
nameprotected final java.lang.String name 
 - 
typeprotected java.lang.Class type 
 - 
PROPERTY_SET_PREFIXpublic static final java.lang.String PROPERTY_SET_PREFIX - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getPropertypublic 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
 
 - 
setPropertypublic 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 property
- newValue- the new value of the property
- Throws:
- java.lang.RuntimeException- if the property could not be set
 
 - 
getNamepublic java.lang.String getName() Return the name of the property- Returns:
- the name of the property
 
 - 
getTypepublic java.lang.Class getType() - Returns:
- the type of the property
 
 - 
getModifierspublic int getModifiers() Returns the access modifier.- Returns:
- Modifier.PUBLIC
 
 - 
getGetterNamepublic static java.lang.String getGetterName(java.lang.String propertyName, java.lang.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
 
 - 
getSetterNamepublic static java.lang.String getSetterName(java.lang.String propertyName) Gets the setter for the getter for this property.- Returns:
- The name of the property. The name is "set"+ the capitalized propertyName.
 
 
- 
 
-