W3cubDocs

/Groovy 3.0

[Java] Class MetaBeanProperty

  • groovy.lang.MetaBeanProperty
public class MetaBeanProperty
extends MetaProperty

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

Inherited fields
Fields inherited from class Fields
class MetaProperty PROPERTY_SET_PREFIX, name, type

Constructor Summary

Constructors
Constructor and description
MetaBeanProperty (String name, Class type, MetaMethod getter, MetaMethod setter)
Sole constructor setting name, type (class), getter and setter.

Methods Summary

Methods
Type Params Return Type Name and description
public CachedField getField()
Gets the field of this property
public MetaMethod getGetter()
Get the getter method.
public int getModifiers()
Gets the visibility modifiers for the property as defined by the getter and setter methods.
public Object getProperty(Object object)
Get the property of the given object.
public MetaMethod getSetter()
Get the setter method.
public void setField(CachedField field)
Sets the field of this property
public void setProperty(Object object, Object newValue)
Set the property on the given object to the new value.

Inherited Methods Summary

Inherited Methods
Methods inherited from class Name
class MetaProperty getGetterName, getModifiers, getName, getProperty, getSetterName, getType, setProperty

Constructor Detail

public MetaBeanProperty(String name, Class type, MetaMethod getter, MetaMethod setter)

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

Method Detail

public CachedField getField()

Gets the field of this property

Returns:
The field of this property

public MetaMethod getGetter()

Get the getter method.

Returns:
the getter method for this property.

public int getModifiers()

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

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

public Object getProperty(Object object)

Get the property of the given object.

throws:
RuntimeException if the property could not be evaluated
Parameters:
object - which to be got
Returns:
the property of the given object

public MetaMethod getSetter()

Get the setter method.

Returns:
the setter method for this property.

public void setField(CachedField field)

Sets the field of this property

Parameters:
field

public void setProperty(Object object, Object newValue)

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

throws:
RuntimeException if the property could not be set
Parameters:
object - on which to set the property
newValue - the new value of the property

© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/groovy/lang/MetaBeanProperty.html