Save This Page
Home » jdo2-model-2.3-ea-src » » [javadoc | source]
public class: ReflectionJavaTypeIntrospector [javadoc | source]
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 Summary:
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from Detail:
 public  void addDeclaredJavaProperties(ReflectionJavaType beanClass) 
    Adds declared properties to the specified ReflectionJavaType instance.