Class BeanProperty

  • Direct Known Subclasses:
    PropertyAccessor, PropertyMutator

    public abstract class BeanProperty
    extends Object
    Represents a bean property, in practice it can be an object field, method (getter/setter) or constructor parameter.
    Author:
    Eugen Cepoi
    • Field Detail

      • name

        protected final String name
      • type

        protected final Type type
      • declaringClass

        protected final Class<?> declaringClass
      • concreteClass

        protected final Class<?> concreteClass
      • modifiers

        protected final int modifiers
    • Constructor Detail

      • BeanProperty

        protected BeanProperty​(String name,
                               Type type,
                               Class<?> declaringClass,
                               Class<?> concreteClass,
                               Annotation[] annotations,
                               int modifiers)
    • Method Detail

      • getDeclaringClass

        public Class<?> getDeclaringClass()
        Returns:
        The class in which this property is declared
      • getConcreteClass

        public Class<?> getConcreteClass()
        Returns:
        The final concrete class from which this property has been resolved. For example if this property is defined in class Root but was resolved for class Child extends Root, then getConcreteClass would return Child class and getDeclaringClass would return Root class.
      • getName

        public String getName()
        The name of this property (not necessarily the original one).
      • getType

        public Type getType()
        Returns:
        the type of the property
      • getRawClass

        public Class<?> getRawClass()
      • getModifiers

        public int getModifiers()
      • aliases

        public String[] aliases()
      • getAnnotation

        public <T extends Annotation> T getAnnotation​(Class<T> annotationClass)