|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jdo.impl.model.java.AbstractJavaModelFactory
org.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory
A reflection based JavaModelFactory implementation.
The implementation takes java.lang.Class and
java.lang.reflect.Field instances to get Java related
metadata about types and fields. This implementation caches JavaModel
instances per ClassLoader.
| Constructor Summary | |
ReflectionJavaModelFactory()
|
|
| Method Summary | |
JavaModel |
createJavaModel(java.lang.Object key)
Creates a new empty JavaModel instance. |
java.lang.ClassLoader |
getClassLoaderPrivileged(java.lang.Class clazz)
Calls getClassLoader on the specified class instance in a doPrivileged block. |
java.lang.Class |
getJavaClass(JavaType javaType)
Returns the java.lang.Class wrapped in the specified
JavaType. |
JavaModel |
getJavaModel(java.lang.Object key)
Returns the JavaModel instance for the specified key. |
JavaType |
getJavaType(java.lang.Object typeDesc)
Returns a JavaType instance for the specified type description (optional operation). |
protected JavaModel |
newJavaModelInstance(java.lang.ClassLoader classLoader)
Creates a new instance of the JavaModel implementation class. |
| Methods inherited from class org.apache.jdo.impl.model.java.AbstractJavaModelFactory |
removeJavaModel, removeJavaModel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ReflectionJavaModelFactory()
| Method Detail |
public JavaModel createJavaModel(java.lang.Object key)
throws ModelException
This implementation only accepts java.lang.ClassLoader
instances as key and does not support null keys. A
ModelException indicates an invalid key.
The method automatically sets the parent/child relationship for the created JavaModel according to the parent/child relationship of the ClassLoader passed as key.
createJavaModel in interface JavaModelFactorycreateJavaModel in class AbstractJavaModelFactorykey - the key that may be used to cache the returned JavaModel
instance.
ModelException - if impossible; the key is of an
inappropriate type or the key is null and this
JavaModelFactory does not support null keys.public JavaModel getJavaModel(java.lang.Object key)
getJavaModel in interface JavaModelFactorygetJavaModel in class AbstractJavaModelFactorykey - the key used to cache the returned JavaModel instance
public JavaType getJavaType(java.lang.Object typeDesc)
getJavaModel(key).getJavaType(typeName).
The ReflectionJavaModelFactory supports this short cut and accepts
java.lang.Class instances as valid arguments for this
method. The method throws a
ModelFatalException, if the specified
type descriptor is not a java.lang.Class instance.
getJavaType in interface JavaModelFactorygetJavaType in class AbstractJavaModelFactorytypeDesc - the type description
ModelFatalException - the specified type description is not
a java.lang.Class instance.public java.lang.ClassLoader getClassLoaderPrivileged(java.lang.Class clazz)
ModelFatalException - wraps the SecurityException thrown by
getClassLoader.public java.lang.Class getJavaClass(JavaType javaType)
java.lang.Class wrapped in the specified
JavaType.
java.lang.Class for the specified
JavaType.
ModelFatalException - the specified JavaType does
not wrap a java.lang.Class instance.protected JavaModel newJavaModelInstance(java.lang.ClassLoader classLoader)
This implementation returns a ReflectionJavaModel
instance.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||