Class ReflectedProperty


  • public class ReflectedProperty
    extends java.lang.Object
    Encapsulates a single JavaBeans-style property
    Since:
    3.3
    • Constructor Summary

      Constructors 
      Constructor Description
      ReflectedProperty​(java.lang.Object object, java.lang.String propertyName)
      Construct a ReflectedProperty on some object, given the property name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String capitalize​(java.lang.String string)  
      java.lang.Object get()
      Return the property's value.
      java.lang.String getPropertyName()
      Returns the property's name.
      java.lang.Class getType()
      Return the property's type.
      boolean isReadOnly()
      Returns if the property is read-only.
      private java.lang.String makeBooleanGetterName​(java.lang.String propertyName)  
      private java.lang.String makeGetterName​(java.lang.String propertyName)  
      private java.lang.String makeSetterName​(java.lang.String propertyName)  
      void set​(java.lang.Object newValue)
      Set the property's value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReflectedProperty

        public ReflectedProperty​(java.lang.Object object,
                                 java.lang.String propertyName)
        Construct a ReflectedProperty on some object, given the property name.
        Parameters:
        object - The object
        propertyName - The property name
    • Method Detail

      • makeBooleanGetterName

        private java.lang.String makeBooleanGetterName​(java.lang.String propertyName)
      • makeSetterName

        private java.lang.String makeSetterName​(java.lang.String propertyName)
      • makeGetterName

        private java.lang.String makeGetterName​(java.lang.String propertyName)
      • capitalize

        private java.lang.String capitalize​(java.lang.String string)
      • getType

        public java.lang.Class getType()
        Return the property's type. This is the same as the type returned by the getter.
        Returns:
        The property's data type.
      • get

        public java.lang.Object get()
        Return the property's value.
        Returns:
        The value in the property.
      • set

        public void set​(java.lang.Object newValue)
        Set the property's value. If the property is read-only, the request is ignored.
        Parameters:
        newValue - The value to set.
      • isReadOnly

        public boolean isReadOnly()
        Returns if the property is read-only.
        Returns:
        false if the property has a setter; true otherwise.
      • getPropertyName

        public java.lang.String getPropertyName()
        Returns the property's name.
        Returns:
        The property name.