Package groovy.lang
Class MetaProperty
java.lang.Object
groovy.lang.MetaProperty
- All Implemented Interfaces:
- MetaMember
- Direct Known Subclasses:
- CachedField,- MetaArrayLengthProperty,- MetaBeanProperty,- MetaExpandoProperty,- MethodMetaProperty,- MultipleSetterProperty
Represents a property on a bean which may have a getter and/or a setter
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionMetaProperty(String name, Class type) Constructor that sets the property name and type (class)
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringgetGetterName(String propertyName, Class type) Gets the name for the getter for this propertyintReturns the access modifiers.getName()Returns the name of the property.abstract ObjectgetProperty(Object object) static StringgetSetterName(String propertyName) Gets the setter for the getter for this property.getType()Returns the ntypeame of the property.abstract voidsetProperty(Object object, Object newValue) Sets the property on the given object to the new value.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface groovy.lang.MetaMemberisFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic
- 
Field Details- 
PROPERTY_SET_PREFIX- See Also:
 
- 
name
- 
type
 
- 
- 
Constructor Details- 
MetaPropertyConstructor that sets the property name and type (class)
 
- 
- 
Method Details- 
getProperty- Returns:
- the property of the given object
- Throws:
- RuntimeException- if the property could not be evaluated
 
- 
setPropertySets 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
 
- 
getNameReturns the name of the property.- Specified by:
- getNamein interface- MetaMember
- Returns:
- the name of the property
 
- 
getTypeReturns the ntypeame of the property.- Returns:
- the type of the property
 
- 
getModifierspublic int getModifiers()Returns the access modifiers.- Specified by:
- getModifiersin interface- MetaMember
- Returns:
- Modifier.PUBLIC
 
- 
getGetterNameGets 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
 
- 
getSetterNameGets the setter for the getter for this property.- Returns:
- The name of the property. The name is "set"+ the capitalized propertyName.
 
 
-