Interface Property<V>

Type Parameters:
V - the type of the properties value
All Known Subinterfaces:

public interface Property<V>
A representation of a JavaBean style property
See Also:
  • Method Details

    • getName

      String getName()
      Returns the name of the property. If the property is a field, then the field name is returned. Otherwise, if the property is a method, then the name that is returned is the getter method name without the "get" or "is" prefix, and a lower case first letter.
      The name of the property
    • getBaseType

      Type getBaseType()
      Returns the property type
      The property type
    • getJavaClass

      Class<V> getJavaClass()
      Returns the property type
      The property type
    • getAnnotatedElement

      AnnotatedElement getAnnotatedElement()
      Get the element responsible for retrieving the property value
    • getMember

      Member getMember()
      Get the member responsible for retrieving the property value
    • getValue

      V getValue(Object instance)
      Returns the property value for the specified bean. The property to be returned is either a field or getter method.
      bean - The bean to read the property from
      The property value
      ClassCastException - if the value is not of the type V
    • setValue

      void setValue(Object instance, V value)
      This method sets the property value for a specified bean to the specified value. The property to be set is either a field or setter method.
      bean - The bean containing the property to set
      value - The new property value
    • getDeclaringClass

      Class<?> getDeclaringClass()
      Returns the class that declares the property
    • isReadOnly

      boolean isReadOnly()
      Indicates whether this is a read-only property
    • setAccessible

      void setAccessible()
      Calls the setAccessible method on the underlying member(s).

      The operation should be performed within a PrivilegedAction

    • isAnnotationPresent

      boolean isAnnotationPresent(Class<? extends Annotation> annotation)
      Indicates whether the given annotation is defined for this property. This method will consider the annotations present in both field and accessor method.
      annotation - The Annotation to check.
      True if the annotation is defined. Otherwise is false.