|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
org.apache.jdo.impl.model.java.reflection.ReflectionJavaTypeIntrospector.PropertyStore
Helper class to introspect a class in order to find properties.
The class provides a public method getPropertyDescriptors()
returning an array of PropertyDescriptors. Each PropertyDescriptor
represents a public or protected property of the class specified as
constructor argument. This code is inspired by the implementation
of java.beans.Introspector class.
Class PropertyStore uses the following algorithm to identify the properties:
Nested Class Summary |
Nested classes inherited from class java.util.HashMap |
|
Nested classes inherited from class java.util.AbstractMap |
|
Field Summary | |
private java.lang.reflect.Method[] |
declaredMethods
The declared method instances for the specified class. |
private static java.lang.String |
GET_PREFIX
|
private static int |
GET_PREFIX_LENGTH
|
private static java.lang.String |
IS_PREFIX
|
private static int |
IS_PREFIX_LENGTH
|
private static java.lang.String |
SET_PREFIX
|
private static int |
SET_PREFIX_LENGTH
|
Fields inherited from class java.util.HashMap |
|
Fields inherited from class java.util.AbstractMap |
|
Constructor Summary | |
ReflectionJavaTypeIntrospector.PropertyStore(java.lang.Class clazz)
Constructor. |
Method Summary | |
private void |
addGetter(java.lang.String propName,
java.lang.reflect.Method method)
Adds a getter method to the methods list for the property with the specified name. |
private void |
addPropertyDescriptor(java.lang.String propName,
java.beans.PropertyDescriptor pd)
Adds a the specified (incomplete) PropertyDescriptor to the list of PropertyDescriptor candidates managed by this PropertyStore. |
private void |
addSetter(java.lang.String propName,
java.lang.reflect.Method method)
Adds a setter method to the methods list for the property with the specified name. |
java.beans.PropertyDescriptor[] |
getPropertyDescriptors()
Returns an array of PropertyDescriptors. |
private java.util.List |
processProperties()
The method returns a list of PropertyDescriptors for the properties managed by this PropertyStore. |
private java.beans.PropertyDescriptor |
processProperty(java.util.List candidates)
The method analyzes the specified list of candidate PropertyDescriptors and returns a single PropertyDescriptor describing the property. |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
private static final java.lang.String GET_PREFIX
private static final int GET_PREFIX_LENGTH
private static final java.lang.String SET_PREFIX
private static final int SET_PREFIX_LENGTH
private static final java.lang.String IS_PREFIX
private static final int IS_PREFIX_LENGTH
private final java.lang.reflect.Method[] declaredMethods
Constructor Detail |
public ReflectionJavaTypeIntrospector.PropertyStore(java.lang.Class clazz)
Method Detail |
public java.beans.PropertyDescriptor[] getPropertyDescriptors()
private void addGetter(java.lang.String propName, java.lang.reflect.Method method)
propName
- the name of the property.method
- the getter method.private void addSetter(java.lang.String propName, java.lang.reflect.Method method)
propName
- the name of the property.method
- the setter method.private void addPropertyDescriptor(java.lang.String propName, java.beans.PropertyDescriptor pd)
propName
- the name of the property.pd
- new PropertyDescriptor.private java.util.List processProperties()
processProperty(List)
.
private java.beans.PropertyDescriptor processProperty(java.util.List candidates)
null
which
means the list of candidate PropertyDescriptors does not qualify
for a valid property.
candidates
- the list of candidate PropertyDescriptors
null
if the candidate PropertyDescriptors do not
qualify for a valid property.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |