Top Description Fields Constructors Methods
groovy.lang

public Class MetaBeanProperty

extends MetaProperty
Class Inheritance
Known Direct Subclasses
org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaProperty, org.codehaus.groovy.runtime.metaclass.ThreadManagedMetaBeanProperty
Imports
org.codehaus.groovy.reflection.CachedField, org.codehaus.groovy.runtime.MetaClassHelper, org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation, 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
private CachedField
private MetaMethod
private MetaMethod
Inherited from groovy.lang.MetaProperty:
namePROPERTY_SET_PREFIXtype

Constructor Summary

AccessConstructor and Description
public
MetaBeanProperty(String name, Class<T> type, MetaMethod getter, MetaMethod setter)

Sole constructor setting name, type (class), getter and setter.

Method Summary

Modifier and TypeMethod and Description
public CachedField

Returns:

The field of this property
getField
()

Gets the field of this property

public MetaMethod

Returns:

the getter method for this property.
getGetter
()

Get the getter method.

public int

Returns:

the visibility modifier of the getter, the setter, or both depending on which exist
getModifiers
()

Overrides groovy.lang.MetaProperty.getModifiers.

Gets the visibility modifiers for the property as defined by the getter and setter methods.
public Object

Returns:

the property of the given object
getProperty
(Object
which to be got
object
)

Implements abstract groovy.lang.MetaProperty.getProperty.

Get the property of the given object.
public MetaMethod

Returns:

the setter method for this property.
getSetter
()

Get the setter method.

public void
setField(CachedField field)

Sets the field of this property

pack-priv void
setGetter(MetaMethod
The getter for this property
getter
)

This is for MetaClass to patch up the object later when looking for get*() methods.

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

Implements abstract groovy.lang.MetaProperty.setProperty.

Set the property on the given object to the new value.
pack-priv void
setSetter(MetaMethod
The setter for this property
setter
)

This is for MetaClass to patch up the object later when looking for set*() methods.

Inherited from groovy.lang.MetaProperty:
getGetterNamegetNamegetSetterNamegetType

Field Detail

fieldback to summary
private CachedField field
getterback to summary
private MetaMethod getter
setterback to summary
private MetaMethod setter

Constructor Detail

MetaBeanPropertyback to summary
public MetaBeanProperty(String name, Class<T> type, MetaMethod getter, MetaMethod setter)

Sole constructor setting name, type (class), getter and setter.

Method Detail

getFieldback to summary
public CachedField getField()

Gets the field of this property

Returns:CachedField

The field of this property

getGetterback to summary
public MetaMethod getGetter()

Get the getter method.

Returns:MetaMethod

the getter method for this property.

getModifiersback to summary
public int getModifiers()

Overrides groovy.lang.MetaProperty.getModifiers.

Gets the visibility modifiers for the property as defined by the getter and setter methods.

Returns:int

the visibility modifier of the getter, the setter, or both depending on which exist

getPropertyback to summary
public Object getProperty(Object object)

Implements abstract groovy.lang.MetaProperty.getProperty.

Get the property of the given object.

Parameters
object:Object

which to be got

Returns:Object

the property of the given object

Exceptions
RuntimeException:
if the property could not be evaluated
getSetterback to summary
public MetaMethod getSetter()

Get the setter method.

Returns:MetaMethod

the setter method for this property.

setFieldback to summary
public void setField(CachedField field)

Sets the field of this property

setGetterback to summary
pack-priv void setGetter(MetaMethod getter)

This is for MetaClass to patch up the object later when looking for get*() methods.

Parameters
getter:MetaMethod

The getter for this property

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

Implements abstract groovy.lang.MetaProperty.setProperty.

Set 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
setSetterback to summary
pack-priv void setSetter(MetaMethod setter)

This is for MetaClass to patch up the object later when looking for set*() methods.

Parameters
setter:MetaMethod

The setter for this property