Interface BeanProperty<T>

  • All Known Implementing Classes:
    BeanPropertyField, BeanPropertySetter

    public interface BeanProperty<T>
    Represents a bean property such as a field or setter method.
     // like...
     @SomeAnnotation
     SomeType someProperty;
     
     // ...or...
     @SomeAnnotation
     void setSomeProperty( SomeType _someProperty )
     {
         // ...etc...
     }
     
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <A extends java.lang.annotation.Annotation>
      A
      getAnnotation​(java.lang.Class<A> annotationType)
      Returns the property annotation with the specified type.
      java.lang.String getName()
      Returns the normalized property name excluding the namespace; for example "address".
      com.google.inject.TypeLiteral<T> getType()
      Returns the reified generic type of the property; for example TypeLiteral<List<String>>.
      <B> void set​(B bean, T value)
      Sets the property in the given bean to the given value.
    • Method Detail

      • getAnnotation

        <A extends java.lang.annotation.Annotation> A getAnnotation​(java.lang.Class<A> annotationType)
        Returns the property annotation with the specified type.
        Parameters:
        annotationType - The annotation type
        Returns:
        Property annotation if it exists; otherwise null
      • getType

        com.google.inject.TypeLiteral<T> getType()
        Returns the reified generic type of the property; for example TypeLiteral<List<String>>.
        Returns:
        Reified generic type
      • getName

        java.lang.String getName()
        Returns the normalized property name excluding the namespace; for example "address".
        Returns:
        Normalized property name
      • set

        <B> void set​(B bean,
                     T value)
        Sets the property in the given bean to the given value.
        Parameters:
        bean - The bean to update
        value - The value to set