Package org.apache.tapestry5.beanmodel.internal.services

## Class PropertyAdapterImpl

- java.lang.Object
- - org.apache.tapestry5.beanmodel.internal.services.PropertyAdapterImpl

- All Implemented Interfaces:
    `AnnotationProvider`, `PropertyAdapter`

      public class PropertyAdapterImpl
      extends java.lang.Object
      implements PropertyAdapter

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `get​(java.lang.Object instance)` | Reads the property value.
    `<T extends java.lang.annotation.Annotation> T` | `getAnnotation​(java.lang.Class<T> annotationClass)` | Searches for the specified annotation, returning the matching annotation instance.
    `java.lang.Class` | `getBeanType()` | Returns the type of bean to which this property belongs.
    `ClassPropertyAdapter` | `getClassAdapter()` | Returns the `ClassPropertyAdapter` that provides access to other properties defined by the same class.
    `java.lang.Class` | `getDeclaringClass()` | The class in which the property (or public field) is defined.
    `java.lang.reflect.Field` | `getField()` | Returns the field if the property is a public field or null if the property is accessed via the read method.
    `java.lang.String` | `getName()` | Returns the name of the property (or public field).
    `java.lang.reflect.Method` | `getReadMethod()` | Returns the method used to read the property, or null if the property is not readable (or is a public field).
    `java.lang.Class` | `getType()` | Returns the type of the property.
    `java.lang.reflect.Method` | `getWriteMethod()` | Returns the method used to update the property, or null if the property is not writeable (or a public field).
    `boolean` | `isCastRequired()` | Returns true if the return type of the read method is not the same as the property type.
    `boolean` | `isField()` | Returns true if the property is actually a public field (possibly, a public static field).
    `boolean` | `isRead()` | Returns true if the property is readable (i.e., has a getter method or is a public field).
    `boolean` | `isUpdate()` | Returns true if the property is writeable (i.e., has a setter method or is a non-final field).
    `void` | `set​(java.lang.Object instance, java.lang.Object value)` | Updates the property value.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `PropertyAdapter`
      Returns the name of the property (or public field).
      Specified by:
        `getName` in interface `PropertyAdapter`

    - #### getReadMethod

          public java.lang.reflect.Method getReadMethod()

      Description copied from interface: `PropertyAdapter`
      Returns the method used to read the property, or null if the property is not readable (or is a public field).
      Specified by:
        `getReadMethod` in interface `PropertyAdapter`

    - #### getType

          public java.lang.Class getType()

      Description copied from interface: `PropertyAdapter`
      Returns the type of the property.
      Specified by:
        `getType` in interface `PropertyAdapter`

    - #### getWriteMethod

          public java.lang.reflect.Method getWriteMethod()

      Description copied from interface: `PropertyAdapter`
      Returns the method used to update the property, or null if the property is not writeable (or a public field).
      Specified by:
        `getWriteMethod` in interface `PropertyAdapter`

    - #### isRead

          public boolean isRead()

      Description copied from interface: `PropertyAdapter`
      Returns true if the property is readable (i.e., has a getter method or is a public field).
      Specified by:
        `isRead` in interface `PropertyAdapter`

    - #### isUpdate

          public boolean isUpdate()

      Description copied from interface: `PropertyAdapter`
      Returns true if the property is writeable (i.e., has a setter method or is a non-final field).
      Specified by:
        `isUpdate` in interface `PropertyAdapter`

    - #### get

          public java.lang.Object get​(java.lang.Object instance)

      Description copied from interface: `PropertyAdapter`
      Reads the property value.
      Specified by:
        `get` in interface `PropertyAdapter`
      Parameters:
        `instance` - to read from

    - #### set

          public void set​(java.lang.Object instance,
                          java.lang.Object value)

      Description copied from interface: `PropertyAdapter`
      Updates the property value. The provided value must not be null if the property type is primitive, and must otherwise be of the proper type.
      Specified by:
        `set` in interface `PropertyAdapter`
      Parameters:
        `instance` - to update
        `value` - new value for the property

    - #### getAnnotation

          public <T extends java.lang.annotation.Annotation> T getAnnotation​(java.lang.Class<T> annotationClass)

      Description copied from interface: `AnnotationProvider`
      Searches for the specified annotation, returning the matching annotation instance.
      Specified by:
        `getAnnotation` in interface `AnnotationProvider`
      Parameters:
        `annotationClass` - used to select the annotation to return
      Returns:
        the annotation, or null if not found

    - #### isCastRequired

          public boolean isCastRequired()

      Description copied from interface: `PropertyAdapter`
      Returns true if the return type of the read method is not the same as the property type. This can occur when the property has been defined using generics, in which case, the method's type may be Object when the property type is something more specific. This method is primarily used when generating runtime code related to the property.
      Specified by:
        `isCastRequired` in interface `PropertyAdapter`

    - #### getClassAdapter

          public ClassPropertyAdapter getClassAdapter()

      Description copied from interface: `PropertyAdapter`
      Returns the `ClassPropertyAdapter` that provides access to other properties defined by the same class.
      Specified by:
        `getClassAdapter` in interface `PropertyAdapter`

    - #### getBeanType

          public java.lang.Class getBeanType()

      Description copied from interface: `PropertyAdapter`
      Returns the type of bean to which this property belongs. This is the same as `ClassPropertyAdapter.getBeanType()`.
      Specified by:
        `getBeanType` in interface `PropertyAdapter`

    - #### isField

          public boolean isField()

      Description copied from interface: `PropertyAdapter`
      Returns true if the property is actually a public field (possibly, a public static field).
      Specified by:
        `isField` in interface `PropertyAdapter`

    - #### getField

          public java.lang.reflect.Field getField()

      Description copied from interface: `PropertyAdapter`
      Returns the field if the property is a public field or null if the property is accessed via the read method.
      Specified by:
        `getField` in interface `PropertyAdapter`

    - #### getDeclaringClass

          public java.lang.Class getDeclaringClass()

      Description copied from interface: `PropertyAdapter`
      The class in which the property (or public field) is defined.
      Specified by:
        `getDeclaringClass` in interface `PropertyAdapter`