public class JDOModelImplDynamic extends JDOElementImpl implements JDOModel
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:
Modifier and Type | Field and Description |
---|---|
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
|
Modifier | Constructor and Description |
---|---|
protected |
JDOModelImplDynamic(JavaModel javaModel,
boolean loadXMLMetadataDefault)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, firePropertyChange, fireVetoableChange, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener
protected static final I18NHelper msg
protected static org.apache.commons.logging.Log xmlLogger
protected static org.apache.commons.logging.Log logger
protected JDOModelImplDynamic(JavaModel javaModel, boolean loadXMLMetadataDefault)
public JDOPackage createJDOPackage(java.lang.String packageName) throws ModelException
createJDOPackage
in interface JDOModel
packageName
- the name of the JDOPackage instance
to be returnedModelException
- 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 returnednull
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 returnedModelException
- 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 notModelException
- 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 returnednull
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 notnull
if not presentModelException
- 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 returnednull
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 classprotected JDOClass newJDOClassInstance(java.lang.String name)
protected boolean isKnownNonPC(java.lang.String typeName)
typeName
- name of the type to be checkedtrue
if types is a name of a primitive type;
false
otherwiseprotected void knownNonPC(java.lang.String className)
className
- the name of the non-pc classCopyright © 2005-2012 Apache Software Foundation. All Rights Reserved.