Save This Page
Home » jdo2-model-2.3-ea-src » org.apache.jdo.impl.model.java.reflection » [javadoc | source]
org.apache.jdo.impl.model.java.reflection
public class: ReflectionJavaTypeIntrospector [javadoc | source]
java.lang.Object
   org.apache.jdo.impl.model.java.reflection.ReflectionJavaTypeIntrospector
Helper class to introspect a ReflectionJavaType representing a class to find its properties.
Nested Class Summary:
static class  ReflectionJavaTypeIntrospector.PropertyStore  Helper class to introspect a class in order to find properties. The class provides a public method {@link #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:

  • Iterate the declared non-static methods that are public or protected.
  • A no-arg method returning a value and having a name staring with "get" is a potential getter method of a property.
  • A no-arg method returning a boolean value and a name starting with "is" is a potential getter method of a property.
  • A void method with a single argument and having a name starting with "set" is a potential setter method of a property.
  • If there exsists an "is" and a "get" method, the "is" method is used as the getter method.
  • If there is a getter method and multiple setter methods, it chooses the setter where the argument has exactly the same type as the getter return type.
  • If there no such matching getter method, none of the setter methods correspond to a property.
 
Method from org.apache.jdo.impl.model.java.reflection.ReflectionJavaTypeIntrospector Summary:
addDeclaredJavaProperties
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jdo.impl.model.java.reflection.ReflectionJavaTypeIntrospector Detail:
 public  void addDeclaredJavaProperties(ReflectionJavaType beanClass) 
    Adds declared properties to the specified ReflectionJavaType instance.