|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.model.jdo.JDOElementImpl
org.apache.jdo.impl.model.jdo.JDOModelImplDynamic
A JDOModel instance bundles a number of JDOClass instances used by an application. It provides factory methods to create and retrieve JDOClass instances. A fully qualified class name must be unique within a JDOModel instance. The model supports multiple classes having the same fully qualified name by different JDOModel instances.
The dynamic JDOModel implementation does not store any internally
calculated values. It is intended to be used in an environment
where JDO metatdata are likely to be changed (e.g. at development
time).
There are two exceptions:
TBD:
Field Summary | |
protected static org.apache.commons.logging.Log |
logger
Logger |
protected static I18NHelper |
msg
I18N support |
protected static org.apache.commons.logging.Log |
xmlLogger
XML Logger |
Constructor Summary | |
protected |
JDOModelImplDynamic(JavaModel javaModel,
boolean loadXMLMetadataDefault)
Constructor. |
Method Summary | |
JDOClass |
createJDOClass(java.lang.String className)
The method returns a JDOClass instance for the specified fully qualified class name. |
JDOClass |
createJDOClass(java.lang.String className,
boolean loadXMLMetadata)
The method returns a JDOClass instance for the specified fully qualified class name. |
JDOPackage |
createJDOPackage(java.lang.String packageName)
The method returns a JDOClass instance for the specified package name. |
JDOClass[] |
getDeclaredClasses()
Returns the collection of JDOClass instances declared by this JDOModel in the format of an array. |
JDOPackage[] |
getDeclaredPackages()
Returns the collection of JDOPackage instances declared by this JDOModel in the format of an array. |
JavaModel |
getJavaModel()
Returns the JavaModel bound to this JDOModel instance. |
JDOClass |
getJDOClass(java.lang.String className)
The method returns the JDOClass instance for the specified fully qualified class name if present. |
JDOClass |
getJDOClass(java.lang.String className,
boolean loadXMLMetadata)
The method returns the JDOClass instance for the specified fully qualified class name if present. |
JDOClass |
getJDOClassForObjectIdClass(JavaType objectIdClass)
This method returns the JDOClass instance that defines the specified type as its objectId class. |
JDOClass |
getJDOClassForShortName(java.lang.String shortName)
The method returns the JDOClass instance for the specified short name (see JDOClass.getShortName() ) or null if it cannot
find a JDOClass instance with the specified short name. |
JDOPackage |
getJDOPackage(java.lang.String packageName)
The method returns the JDOPackage instance for the specified package name, if present. |
JDOModel |
getParent()
Returns the parent JDOModel instance of this JDOModel. |
protected boolean |
isKnownNonPC(java.lang.String typeName)
Checks whether the type with the specified name does NOT denote a persistence-capable class. |
protected void |
knownNonPC(java.lang.String className)
Hook called when a class is known to be non persistence capable. |
protected JDOClass |
newJDOClassInstance(java.lang.String name)
Returns a new instance of the JDOClass implementation class. |
void |
setJavaModel(JavaModel javaModel)
Sets the JavaModel for this JDOModel instance. |
Methods inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl |
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, firePropertyChange, fireVetoableChange, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jdo.model.jdo.JDOElement |
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
Field Detail |
protected static final I18NHelper msg
protected static org.apache.commons.logging.Log xmlLogger
protected static org.apache.commons.logging.Log logger
Constructor Detail |
protected JDOModelImplDynamic(JavaModel javaModel, boolean loadXMLMetadataDefault)
Method Detail |
public JDOPackage createJDOPackage(java.lang.String packageName) throws ModelException
createJDOPackage
in interface JDOModel
packageName
- the name of the JDOPackage instance
to be returned
ModelException
- if impossiblepublic JDOPackage getJDOPackage(java.lang.String packageName)
null
if it cannot
find a JDOPackage instance for the specified name.
getJDOPackage
in interface JDOModel
packageName
- the name of the JDOPackage instance
to be returned
null
if not presentpublic JDOPackage[] getDeclaredPackages()
getDeclaredPackages
in interface JDOModel
public JDOClass createJDOClass(java.lang.String className) throws ModelException
Whether this method reads XML metatdata or not is determined at
JDOModel creation time (see flag loadXMLMetadataDefault
in JDOModelFactory.getJDOModel(JavaModel javaModel, boolean
loadXMLMetadataDefault)
). Invoking this method is method is equivalent
to createJDOClass(className, loadXMLMetadataDefault)
.
createJDOClass
in interface JDOModel
className
- the fully qualified class name of the JDOClass
instance to be returned
ModelException
- if impossiblepublic JDOClass createJDOClass(java.lang.String className, boolean loadXMLMetadata) throws ModelException
true
the method tries to find the JDOClass
instance by reading the XML metadata. If it could not be found the method
creates a new JDOClass instance, sets its declaringModel and returns the
instance.
createJDOClass
in interface JDOModel
className
- the fully qualified class name of the JDOClass instance
to be returnedloadXMLMetadata
- indicated whether to read XML metadata or not
ModelException
- if impossiblepublic JDOClass getJDOClass(java.lang.String className)
null
if it cannot find a JDOClass instance for the specified name.
Whether this method reads XML metatdata or not is determined at
JDOModel creation time (see flag loadXMLMetadataDefault
in JDOModelFactory.getJDOModel(JavaModel javaModel, boolean
loadXMLMetadataDefault)
). Invoking this method is method is equivalent
to createJDOClass(className, loadXMLMetadataDefault)
.
getJDOClass
in interface JDOModel
className
- the fully qualified class name of the JDOClass
instance to be returned
null
if not presentpublic JDOClass getJDOClass(java.lang.String className, boolean loadXMLMetadata)
true
the method tries to find the JDOClass instance by
reading the XML metadata. The method returns null if it cannot find a
JDOClass instance for the specified name.
getJDOClass
in interface JDOModel
className
- the fully qualified class name of the JDOClass instance
to be returnedloadXMLMetadata
- indicate whether to read XML metatdata or not
null
if not present
ModelException
- if impossiblepublic JDOClass getJDOClassForShortName(java.lang.String shortName)
JDOClass.getShortName()
) or null
if it cannot
find a JDOClass instance with the specified short name.
The method searches the list of JDOClasses currently managed by this
JDOModel instance. It does not attempt to load any metadata if it
cannot find a JDOClass instance with the specified short name. The
metadata for a JDOClass returned by this method must have been loaded
before by any of the methods
createJDOClass(String className)
,
createJDOClass(String className, boolean loadXMLMetadataDefault)
,
getJDOClass(String className)
, or
getJDOClass(String className, boolean loadXMLMetadataDefault)
.
getJDOClassForShortName
in interface JDOModel
shortName
- the short name of the JDOClass instance to be returned
null
if not presentpublic JDOClass[] getDeclaredClasses()
getDeclaredClasses
in interface JDOModel
public JavaModel getJavaModel()
getJavaModel
in interface JDOModel
public void setJavaModel(JavaModel javaModel)
setJavaModel
in interface JDOModel
javaModel
- the JavaModelpublic JDOModel getParent()
public JDOClass getJDOClassForObjectIdClass(JavaType objectIdClass)
JDOClass.getPersistenceCapableSuperclass()
).
getJDOClassForObjectIdClass
in interface JDOModel
objectIdClass
- the type representation of the ObjectId class
protected JDOClass newJDOClassInstance(java.lang.String name)
protected boolean isKnownNonPC(java.lang.String typeName)
typeName
- name of the type to be checked
true
if types is a name of a primitive type;
false
otherwiseprotected void knownNonPC(java.lang.String className)
className
- the name of the non-pc class
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |