Class PropertyDescriptor


  • public class PropertyDescriptor
    extends Descriptor
    Property descriptor. It consist of read, write and field descriptor. Only one of those three descriptors may exist.
    • Field Detail

      • name

        protected final java.lang.String name
      • type

        protected java.lang.Class type
      • getters

        protected Getter[] getters
      • setters

        protected Setter[] setters
    • Constructor Detail

      • PropertyDescriptor

        public PropertyDescriptor​(ClassDescriptor classDescriptor,
                                  java.lang.String propertyName,
                                  FieldDescriptor fieldDescriptor)
        Creates field-only property descriptor.
    • Method Detail

      • findField

        protected FieldDescriptor findField​(java.lang.String fieldName)
        Locates property field. Field is being searched also in all superclasses of current class.
      • getName

        public java.lang.String getName()
        Returns property name.
        Specified by:
        getName in class Descriptor
      • getReadMethodDescriptor

        public MethodDescriptor getReadMethodDescriptor()
        Returns read method of this property. May be null if read method is not defined.
      • getWriteMethodDescriptor

        public MethodDescriptor getWriteMethodDescriptor()
        Returns write method of this property. May be null for read-only properties.
      • getFieldDescriptor

        public FieldDescriptor getFieldDescriptor()
        Returns the associated field of this property. May be null if properties are not enhanced by field description.
      • isFieldOnly

        public boolean isFieldOnly()
        Returns true if this is an extended property with only field definition and without getter and setter.
      • isGetterOnly

        public boolean isGetterOnly()
        Returns true if this property has only a getter method.
      • isSetterOnly

        public boolean isSetterOnly()
        Returns true if this property has only a setter method.
      • getType

        public java.lang.Class getType()
        Returns property type. Raw types are detected.
      • getGetter

        public Getter getGetter​(boolean declared)
        Returns Getter. May return null if no matched getter is found.
      • createGetter

        protected Getter createGetter​(boolean declared)
        Creates a Getter.
      • getSetter

        public Setter getSetter​(boolean declared)
        Returns Setter. May return null if no matched setter is found.
      • createSetter

        protected Setter createSetter​(boolean declared)
        Creates a Setter.
      • resolveKeyType

        public java.lang.Class resolveKeyType​(boolean declared)
        Resolves key type for given property descriptor.
      • resolveComponentType

        public java.lang.Class resolveComponentType​(boolean declared)
        Resolves component type for given property descriptor.