Interface ClassPropertyAdapter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object get​(java.lang.Object instance, java.lang.String propertyName)
      Reads the value of a property.
      java.lang.annotation.Annotation getAnnotation​(java.lang.Object instance, java.lang.String propertyName, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
      Returns the annotation of a given property for the specified type if such an annotation is present, else null.
      java.lang.Class getBeanType()
      Returns the type of bean this adapter provides properties for.
      PropertyAdapter getPropertyAdapter​(java.lang.String name)
      Returns the property adapter with the given name, or null if no such adapter exists.
      java.util.List<java.lang.String> getPropertyNames()
      Returns the names of all properties, sorted into alphabetic order.
      void set​(java.lang.Object instance, java.lang.String propertyName, java.lang.Object value)
      Updates the value of a property.
    • Method Detail

      • getPropertyNames

        java.util.List<java.lang.String> getPropertyNames()
        Returns the names of all properties, sorted into alphabetic order. This includes true properties (as defined in the JavaBeans specification), but also public fields. Starting in Tapestry 5.3, even public static fields are included.
        Returns:
        the property names.
      • getBeanType

        java.lang.Class getBeanType()
        Returns the type of bean this adapter provides properties for.
        Returns:
        the type of the bean.
      • getPropertyAdapter

        PropertyAdapter getPropertyAdapter​(java.lang.String name)
        Returns the property adapter with the given name, or null if no such adapter exists.
        Parameters:
        name - of the property (case is ignored)
        Returns:
        the PropertyAdapter instance associated with that property
      • get

        java.lang.Object get​(java.lang.Object instance,
                             java.lang.String propertyName)
        Reads the value of a property.
        Parameters:
        instance - the object to read a value from
        propertyName - the name of the property to read (case is ignored)
        Returns:
        the value
        Throws:
        java.lang.UnsupportedOperationException - if the property is write only
        java.lang.IllegalArgumentException - if property does not exist
      • set

        void set​(java.lang.Object instance,
                 java.lang.String propertyName,
                 java.lang.Object value)
        Updates the value of a property.
        Parameters:
        instance - the object to update
        propertyName - the name of the property to update (case is ignored)
        value - the value to be set
        Throws:
        java.lang.UnsupportedOperationException - if the property is read only
        java.lang.IllegalArgumentException - if property does not exist
      • getAnnotation

        java.lang.annotation.Annotation getAnnotation​(java.lang.Object instance,
                                                      java.lang.String propertyName,
                                                      java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
        Returns the annotation of a given property for the specified type if such an annotation is present, else null.
        Parameters:
        instance - the object to read a value from
        propertyName - the name of the property to read (case is ignored)
        annotationClass - the type of annotation to return
        Returns:
        the Annotation instance
        Throws:
        java.lang.IllegalArgumentException - if property does not exist
        Since:
        5.4