Top Description Fields Constructors Methods
groovy.lang

public abstract Class MetaProperty

extends Object
Class Inheritance
Known Direct Subclasses
groovy.lang.MetaExpandoProperty, org.codehaus.groovy.reflection.CachedField, org.codehaus.groovy.runtime.metaclass.MethodMetaProperty, org.codehaus.groovy.runtime.metaclass.MultipleSetterProperty, groovy.lang.MetaArrayLengthProperty, groovy.lang.MetaBeanProperty
Imports
java.lang.reflect.Modifier

Represents a property on a bean which may have a getter and/or a setter

Field Summary

Modifier and TypeField and Description
protected final String
public static final String
protected Class<T>

Constructor Summary

AccessConstructor and Description
public
MetaProperty(String name, Class<T> type)

Constructor that sets the property name and type (class)

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

The name of the property. The name is "get"+ the capitalized propertyName or, in the case of boolean values, "is" + the capitalized propertyName
getGetterName
(String propertyName, Class<T> type)

Gets the name for the getter for this property

public int

Returns:

Modifier.PUBLIC
getModifiers
()

Returns the access modifier.

public String

Returns:

the name of the property
getName
()

Return the name of the property

public abstract Object

Returns:

the property of the given object
getProperty
(Object object)

public static String

Returns:

The name of the property. The name is "set"+ the capitalized propertyName.
getSetterName
(String propertyName)

Gets the setter for the getter for this property.

public Class<T>

Returns:

the type of the property
getType
()

public abstract void
setProperty(Object
on which to set the property
object
,
Object
the new value of the property
newValue
)

Sets the property on the given object to the new value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
protected final String name
PROPERTY_SET_PREFIXback to summary
public static final String PROPERTY_SET_PREFIX
typeback to summary
protected Class<T> type

Constructor Detail

MetaPropertyback to summary
public MetaProperty(String name, Class<T> type)

Constructor that sets the property name and type (class)

Method Detail

getGetterNameback to summary
public static String getGetterName(String propertyName, Class<T> type)

Gets the name for the getter for this property

Returns:String

The name of the property. The name is "get"+ the capitalized propertyName or, in the case of boolean values, "is" + the capitalized propertyName

getModifiersback to summary
public int getModifiers()

Returns the access modifier.

Returns:int

Modifier.PUBLIC

getNameback to summary
public String getName()

Return the name of the property

Returns:String

the name of the property

getPropertyback to summary
public abstract Object getProperty(Object object)
Returns:Object

the property of the given object

Exceptions
RuntimeException:
if the property could not be evaluated
getSetterNameback to summary
public static String getSetterName(String propertyName)

Gets the setter for the getter for this property.

Returns:String

The name of the property. The name is "set"+ the capitalized propertyName.

getTypeback to summary
public Class<T> getType()
Returns:Class<T>

the type of the property

setPropertyback to summary
public abstract void setProperty(Object object, Object newValue)

Sets the property on the given object to the new value.

Parameters
object:Object

on which to set the property

newValue:Object

the new value of the property

Exceptions
RuntimeException:
if the property could not be set