MetaBeanProperty (Groovy 5.0.0)

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)`

  - ### 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)

  - ### Method Detail

    - #### public CachedField getField()

      Gets the field of this property.

    - #### public MetaMethod getGetter()

      Gets the getter method of this property.

    - #### @Override
      public int getModifiers()

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

    - #### @Override
      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.

    - #### @Override
      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