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: ReflectionJavaType [javadoc | source]
java.lang.Object
   org.apache.jdo.impl.model.java.AbstractJavaType
      org.apache.jdo.impl.model.java.BaseReflectionJavaType
         org.apache.jdo.impl.model.java.reflection.ReflectionJavaType

All Implemented Interfaces:
    JavaType

A reflection based JavaType implementation used at runtime. The implementation takes java.lang.Class and java.lang.reflect.Field instances to get Java related metadata about types and fields.
Field Summary
protected final  ReflectionJavaModel declaringJavaModel    The declaring JavaModel instance. 
protected  Map declaredJavaFields    Map of JavaField instances, key is the field name. 
protected  Map declaredJavaProperties    Map of JavaProperty instances, key is the property name. 
Fields inherited from org.apache.jdo.impl.model.java.BaseReflectionJavaType:
clazz,  superclass
Constructor:
 public ReflectionJavaType(Class clazz,
    ReflectionJavaModel declaringJavaModel) 
    Constructor.
Method from org.apache.jdo.impl.model.java.reflection.ReflectionJavaType Summary:
createJavaMethod,   createJavaProperty,   getArrayComponentType,   getDeclaredJavaField,   getDeclaredJavaFields,   getDeclaredJavaProperties,   getDeclaredJavaProperty,   getJDOClass,   getJavaField,   getJavaProperty,   getJavaTypeForClass,   getSuperclass,   introspectClass,   isArray,   isPersistenceCapable,   newJavaFieldInstance,   newJavaFieldInstance,   newJavaMethodInstance,   newJavaPropertyInstance
Methods from org.apache.jdo.impl.model.java.BaseReflectionJavaType:
getDeclaredJavaFields,   getDeclaredJavaProperties,   getJavaClass,   getJavaField,   getJavaProperty,   getModifiers,   getName,   getSuperclass,   getUnderlyingObject,   isCompatibleWith,   isInterface
Methods from org.apache.jdo.impl.model.java.AbstractJavaType:
equals,   getArrayComponentType,   getDeclaredJavaFields,   getDeclaredJavaProperties,   getJDOClass,   getJavaField,   getJavaProperty,   getModifiers,   getName,   getSuperclass,   getUnderlyingObject,   hashCode,   isArray,   isCompatibleWith,   isFloatingPoint,   isIntegral,   isInterface,   isJDOSupportedCollection,   isJDOSupportedMap,   isOrderable,   isPersistenceCapable,   isPrimitive,   isTrackable,   isValue,   isWrapperClass,   toString
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.ReflectionJavaType Detail:
 public JavaMethod createJavaMethod(Method method) 
    Creates a new JavaMethod instance.
 public synchronized JavaProperty createJavaProperty(String name,
    JavaMethod getter,
    JavaMethod setter,
    JavaType type) throws ModelFatalException 
    Creates a new JavaProperty instance and adds it to the list of declared properties of this class.
 public JavaType getArrayComponentType() 
    Returns the JavaType representing the component type of an array. If this JavaType does not represent an array type this method returns null.
 public synchronized JavaField getDeclaredJavaField(String fieldName) 
    Returns a JavaField instance that reflects the declared field with the specified name of the class or interface represented by this JavaType instance. The method returns null, if the class or interface does not declared a field with that name. It does not check whether one of its superclasses declares such a field.
 public JavaField[] getDeclaredJavaFields() 
    Returns an array of JavaField instances representing the declared fields of the class represented by this JavaType instance. Note, this method does not return JavaField instances representing inherited fields.
 public JavaProperty[] getDeclaredJavaProperties() 
    Returns an array of JavaProperty instances representing the declared properties of the class represented by this JavaType instance. Note, this method does not return JavaField instances representing inherited properties.
 public JavaProperty getDeclaredJavaProperty(String name) 
    Returns a JavaProperty instance that reflects the declared property with the specified name of the class or interface represented by this JavaType instance. The method returns null, if the class or interface does not declared a property with that name. It does not check whether one of its superclasses declares such a property.
 public synchronized JDOClass getJDOClass() throws ModelFatalException 
    Returns the JDOClass instance if this JavaType represents a persistence capable class. The method returns null, if this JavaType does not represent a persistence capable class.

    A org.apache.jdo.model.ModelFatalException indicates a problem accessing the JDO meta data for this JavaType.

 public JavaField getJavaField(String fieldName) 
    Returns a JavaField instance that reflects the field with the specified name of the class or interface represented by this JavaType instance. The method returns null, if the class or interface (or one of its superclasses) does not have a field with that name.
 public JavaProperty getJavaProperty(String name) 
    Returns a JavaProperty instance that reflects the property with the specified name of the class or interface represented by this JavaType instance. The method returns null, if the class or interface (or one of its superclasses) does not have a field with that name.
 public JavaType getJavaTypeForClass(Class clazz) 
    Returns a JavaType instance for the specified Class object. This method provides a hook such that ReflectionJavaType subclasses can implement their own mapping of Class objects to JavaType instances.
 public synchronized JavaType getSuperclass() 
    Returns the JavaType representing the superclass of the entity represented by this JavaType. If this JavaType represents either the Object class, an interface, a primitive type, or void, then null is returned. If this object represents an array class then the JavaType instance representing the Object class is returned.
 protected synchronized  void introspectClass() 
    Helper method to introspect the class and set the declared fields and properties.
 public boolean isArray() 
    Determines if this JavaType object represents an array type.
 public boolean isPersistenceCapable() throws ModelFatalException 
 protected JavaField newJavaFieldInstance(Field field) 
    Creates a new instance of the JavaField implementation class.

    This implementation returns a ReflectionJavaField instance.

 protected JavaField newJavaFieldInstance(String fieldName,
    JavaType type) 
    Creates a new instance of the JavaField implementation class.

    This implementation returns a ReflectionJavaField instance.

 protected JavaMethod newJavaMethodInstance(Method method) 
    Creates a new instance of the JavaMethod implementation class.

    This implementation returns a ReflectionJavaMethod instance.

 protected JavaProperty newJavaPropertyInstance(String name,
    JavaMethod getter,
    JavaMethod setter,
    JavaType type) throws ModelFatalException 
    Creates a new instance of the JavaProperty implementation class.

    This implementation returns a JavaPropertyImpl instance.