Package jodd.introspector
Class Properties
- java.lang.Object
-
- jodd.introspector.Properties
-
public class Properties extends java.lang.ObjectBean properties collection. Property in Java is defined as a pair of read and write method. In Jodd, property can be extended with field definition. Moreover, properties will include just single fields. This behavior can be controlled viaClassDescriptor.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassDescriptorclassDescriptorprotected java.util.HashMap<java.lang.String,PropertyDescriptor>propertyDescriptors
-
Constructor Summary
Constructors Constructor Description Properties(ClassDescriptor classDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddProperty(java.util.HashMap<java.lang.String,PropertyDescriptor> map, java.lang.String name, MethodDescriptor methodDescriptor, boolean isSetter)Adds a setter and/or getter method to the property.protected PropertyDescriptorcreatePropertyDescriptor(java.lang.String name, FieldDescriptor fieldDescriptor)Creates new field-onlyPropertyDescriptor.protected PropertyDescriptorcreatePropertyDescriptor(java.lang.String name, MethodDescriptor getterMethod, MethodDescriptor setterMethod)Creates newPropertyDescriptor.PropertyDescriptor[]getAllPropertyDescriptors()Returns all property descriptors.PropertyDescriptorgetPropertyDescriptor(java.lang.String name)Returnsproperty descriptor.protected java.util.HashMap<java.lang.String,PropertyDescriptor>inspectProperties()Inspects all properties of target type.
-
-
-
Field Detail
-
classDescriptor
protected final ClassDescriptor classDescriptor
-
propertyDescriptors
protected final java.util.HashMap<java.lang.String,PropertyDescriptor> propertyDescriptors
-
-
Constructor Detail
-
Properties
public Properties(ClassDescriptor classDescriptor)
-
-
Method Detail
-
inspectProperties
protected java.util.HashMap<java.lang.String,PropertyDescriptor> inspectProperties()
Inspects all properties of target type.
-
addProperty
protected void addProperty(java.util.HashMap<java.lang.String,PropertyDescriptor> map, java.lang.String name, MethodDescriptor methodDescriptor, boolean isSetter)
Adds a setter and/or getter method to the property. If property is already defined, the new, updated, definition will be created.
-
createPropertyDescriptor
protected PropertyDescriptor createPropertyDescriptor(java.lang.String name, MethodDescriptor getterMethod, MethodDescriptor setterMethod)
Creates newPropertyDescriptor. Note that this method may be called up to three times (depends on use case) for the same property. Each time when a property is updated, a new definition is created with updated information.
-
createPropertyDescriptor
protected PropertyDescriptor createPropertyDescriptor(java.lang.String name, FieldDescriptor fieldDescriptor)
Creates new field-onlyPropertyDescriptor. It will be invoked only once.
-
getPropertyDescriptor
public PropertyDescriptor getPropertyDescriptor(java.lang.String name)
Returnsproperty descriptor.
-
getAllPropertyDescriptors
public PropertyDescriptor[] getAllPropertyDescriptors()
Returns all property descriptors. Properties are sorted by name.
-
-