Package jodd.introspector
Class PropertyDescriptor
java.lang.Object
jodd.introspector.Descriptor
jodd.introspector.PropertyDescriptor
Property descriptor. It consist of read, write and field descriptor.
Only one of those three descriptors may exist.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FieldDescriptorprotected Getter[]protected final Stringprotected final MethodDescriptorprotected Setter[]protected Classprotected final MethodDescriptorFields inherited from class jodd.introspector.Descriptor
classDescriptor, isPublic -
Constructor Summary
ConstructorsConstructorDescriptionPropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, FieldDescriptor fieldDescriptor) Creates field-only property descriptor.PropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, MethodDescriptor readMethod, MethodDescriptor writeMethod) Creates property descriptor. -
Method Summary
Modifier and TypeMethodDescriptionprotected GettercreateGetter(boolean declared) Creates aGetter.protected SettercreateSetter(boolean declared) Creates aSetter.protected FieldDescriptorLocates property field.Returns the associated field of this property.getGetter(boolean declared) ReturnsGetter.getName()Returns property name.Returns read method of this property.getSetter(boolean declared) ReturnsSetter.getType()Returns property type.Returns write method of this property.booleanReturnstrueif this is an extended property with only field definition and without getter and setter.booleanReturnstrueif this property has only a getter method.booleanReturnstrueif this property has only a setter method.resolveComponentType(boolean declared) Resolves component type for given property descriptor.resolveKeyType(boolean declared) Resolves key type for given property descriptor.Methods inherited from class jodd.introspector.Descriptor
getClassDescriptor, isPublic, matchDeclared
-
Field Details
-
name
-
readMethodDescriptor
-
writeMethodDescriptor
-
fieldDescriptor
-
type
-
getters
-
setters
-
-
Constructor Details
-
PropertyDescriptor
public PropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, FieldDescriptor fieldDescriptor) Creates field-only property descriptor. -
PropertyDescriptor
public PropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, MethodDescriptor readMethod, MethodDescriptor writeMethod) Creates property descriptor.
-
-
Method Details
-
findField
Locates property field. Field is being searched also in all superclasses of current class. -
getName
Returns property name.- Specified by:
getNamein classDescriptor
-
getReadMethodDescriptor
Returns read method of this property. May benullif read method is not defined. -
getWriteMethodDescriptor
Returns write method of this property. May benullfor read-only properties. -
getFieldDescriptor
Returns the associated field of this property. May benullif properties are not enhanced by field description. -
isFieldOnly
public boolean isFieldOnly()Returnstrueif this is an extended property with only field definition and without getter and setter. -
isGetterOnly
public boolean isGetterOnly()Returnstrueif this property has only a getter method. -
isSetterOnly
public boolean isSetterOnly()Returnstrueif this property has only a setter method. -
getType
Returns property type. Raw types are detected. -
getGetter
ReturnsGetter. May returnnullif no matched getter is found. -
createGetter
Creates aGetter. -
getSetter
ReturnsSetter. May returnnullif no matched setter is found. -
createSetter
Creates aSetter. -
resolveKeyType
Resolves key type for given property descriptor. -
resolveComponentType
Resolves component type for given property descriptor.
-