Package: groovy.lang

## [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)` Creates a bean-style meta property backed by optional accessor methods.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public CachedField` | `getField()` Gets the field of this property.
    `` | `public MetaMethod` | `getGetter()` Gets the getter method of this property.
    `` | `public int` | `getModifiers()` Gets the visibility modifiers of the property as defined by the getter, setter and field.
    `` | `public Object` | `getProperty(Object object)` Gets the property of the given object.
    `` | `public MetaMethod` | `getSetter()` Gets the setter method of this property.
    `` | `public void` | `setField(CachedField field)` Sets the field of this property.
    `` | `public void` | `setProperty(Object object, Object newValue)` Sets 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)

      Creates a bean-style meta property backed by optional accessor methods.

      Parameters:
        `name` - the Groovy property name
        `type` - the declared property type
        `getter` - the getter meta method, or `null`
        `setter` - the setter meta method, or `null`

  - ### Method Detail

    - #### public CachedField getField()

      Gets the field of this property.

    - #### public MetaMethod getGetter()

      Gets the getter method of this property.

    - #### public int getModifiers()

      Gets the visibility modifiers of the property as defined by the getter, setter and field.

    - #### public Object getProperty(Object object)

      Gets 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()

      Gets the setter method of this property.

    - #### public void setField(CachedField field)

      Sets the field of this property.

    - #### public void setProperty(Object object, Object newValue)

      Sets 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