org.apache.jdo.impl.model.jdo.xml
Class XMLExists.XMLExistsJDOModelFactory

java.lang.Object
  extended byorg.apache.jdo.impl.model.java.AbstractJavaModelFactory
      extended byorg.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory
          extended byorg.apache.jdo.impl.model.jdo.xml.XMLExists.XMLExistsJDOModelFactory
All Implemented Interfaces:
JavaModelFactory
Enclosing class:
XMLExists

private static class XMLExists.XMLExistsJDOModelFactory
extends ReflectionJavaModelFactory

JavaModelFactory implementation. We cannot use the RuntimeJavaModelFactory, because it registers a JDOImplHelper event listener to populate enhancer generated metadata into the model. Since XMLExists checks whether JDO metadata is present from a .jdo we do not want to the enhancer generated metadata.


Field Summary
 
Fields inherited from class org.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory
 
Fields inherited from class org.apache.jdo.impl.model.java.AbstractJavaModelFactory
 
Constructor Summary
protected XMLExists.XMLExistsJDOModelFactory()
           
 
Method Summary
 JavaModel createJavaModel(java.lang.Object key)
          Creates a new empty JavaModel instance.
protected  void setJDOModelInternal(JavaModel javaModel)
          Sets the JDOModel instance for the specified JavaModel.
 
Methods inherited from class org.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory
forNamePrivileged, getClassLoaderPrivileged
 
Methods inherited from class org.apache.jdo.impl.model.java.AbstractJavaModelFactory
getJavaModel, getJavaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLExists.XMLExistsJDOModelFactory

protected XMLExists.XMLExistsJDOModelFactory()
Method Detail

createJavaModel

public JavaModel createJavaModel(java.lang.Object key)
                          throws ModelException
Description copied from class: AbstractJavaModelFactory
Creates a new empty JavaModel instance. A factory implementation may use the specified key when caching the new JavaModel instance.

Each JavaModelFactory imposes its own restrictions for the keys to cache JavaModel instances. Some implementation will allow only keys of a certain type. Some implementations will prohibit null keys. Attempting to use an ineligible key will result in a ModelException. This means the specified key is of an inappropriate type for this JavaModelFactory or if the key is null and this JavaModelFactory does not support null keys.

Specified by:
createJavaModel in interface JavaModelFactory
Specified by:
createJavaModel in class AbstractJavaModelFactory
Parameters:
key - the key that may be used to cache the returned JavaModel instance.
Returns:
a new JavaModel instance.
Throws:
ModelException - if impossible; the key is of an inappropriate type or the key is null and this JavaModelFactory does not support null keys.

setJDOModelInternal

protected void setJDOModelInternal(JavaModel javaModel)
Sets the JDOModel instance for the specified JavaModel.

Parameters:
javaModel - the JavaModel