Package: groovy.swing.model

## [Java] Class PropertyModel

- groovy.swing.model.PropertyModel

- All Implemented Interfaces and Traits:
    NestedValueModel, ValueModel

      public class PropertyModel
      extends Object
      implements NestedValueModel, ValueModel

  Exposes a named property of another ValueModel as its own value model.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `PropertyModel(ValueModel sourceModel, String property)` Creates a writable property model with Object as its declared type.
    `PropertyModel(ValueModel sourceModel, String property, Class type)` Creates a writable property model with an explicit declared type.
    `PropertyModel(ValueModel sourceModel, String property, Class type, boolean editable)` Creates a property model with explicit type and editability.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public String` | `getProperty()` Returns the property name represented by this model.
    `` | `public ValueModel` | `getSourceModel()` Returns the model that supplies the owning object for the bound property.
    `` | `public Class` | `getType()` Returns the declared property type.
    `` | `public Object` | `getValue()` Reads the current property value from the source object.
    `` | `public boolean` | `isEditable()` Indicates whether writes should be forwarded to the source property.
    `` | `public void` | `setValue(Object value)` Writes a new value to the property on the current source object.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public PropertyModel(ValueModel sourceModel, String property)

      Creates a writable property model with Object as its declared type.

      Parameters:
        `sourceModel` - the model that supplies the owning object
        `property` - the property name to access

    - #### public PropertyModel(ValueModel sourceModel, String property, Class type)

      Creates a writable property model with an explicit declared type.

      Parameters:
        `sourceModel` - the model that supplies the owning object
        `property` - the property name to access
        `type` - the declared property type

    - #### public PropertyModel(ValueModel sourceModel, String property, Class type, boolean editable)

      Creates a property model with explicit type and editability.

      Parameters:
        `sourceModel` - the model that supplies the owning object
        `property` - the property name to access
        `type` - the declared property type
        `editable` - whether writes should be forwarded to the source property

  - ### Method Detail

    - #### public String getProperty()

      Returns the property name represented by this model.

      Returns:
        the property name

    - #### public ValueModel getSourceModel()

      Returns the model that supplies the owning object for the bound property.

      Returns:
        the nested source model

    - #### public Class getType()

      Returns the declared property type.

      Returns:
        the property type

    - #### public Object getValue()

      Reads the current property value from the source object.

      Returns:
        the current property value, or `null` when the source object is `null`

    - #### public boolean isEditable()

      Indicates whether writes should be forwarded to the source property.

      Returns:
        `true` when the property model is writable

    - #### public void setValue(Object value)

      Writes a new value to the property on the current source object.

      Parameters:
        `value` - the new property value