org.apache.jdo.model.jdo
Interface JDOModelFactory

All Known Implementing Classes:
JDOModelFactoryImplCaching, JDOModelFactoryImplDynamic

public interface JDOModelFactory

Factory for JDOModel instances. The factory provides a mechanism to cache JDOModel instances per user defined keys.

Version:
2.0
Author:
Michael Bouschen

Method Summary
 JDOModel createJDOModel(JavaModel javaModel, boolean loadXMLMetadataDefault)
          Creates a new empty JDOModel instance.
 JDOModel getJDOModel(JavaModel javaModel)
          Returns the JDOModel instance for the specified javaModel.
 JDOModel getJDOModel(JavaModel javaModel, boolean loadXMLMetadataDefault)
          Returns the JDOModel instance for the specified javaModel.
 void removeJDOModel(JavaModel javaModel)
          Removes the JDOModel for the specified javaModel from the JDOModel cache.
 void removeJDOModel(JDOModel jdoModel)
          Removes the specified jdoModel from the JDOModel cache.
 

Method Detail

createJDOModel

JDOModel createJDOModel(JavaModel javaModel,
                        boolean loadXMLMetadataDefault)
                        throws ModelException
Creates a new empty JDOModel instance. The returned JDOModel instance uses the specified flag loadXMLMetadataDefault to set the default behavior for the creation of new JDOClass instances using methods JDOModel.createJDOClass(String) and JDOModel.getJDOClass(String) for which the caller doesn't explicitly specify whether to read XML metatdata or not.

Parameters:
loadXMLMetadataDefault - the default setting for whether to read XML metatdata in JDOModel's methods for JDOClass creation.
Throws:
ModelException - if impossible

getJDOModel

JDOModel getJDOModel(JavaModel javaModel)
Returns the JDOModel instance for the specified javaModel.

Parameters:
javaModel - the javaModel used to cache the returned JDOModel instance.

getJDOModel

JDOModel getJDOModel(JavaModel javaModel,
                     boolean loadXMLMetadataDefault)
Returns the JDOModel instance for the specified javaModel. The returned JDOModel instance uses the specified flag loadXMLMetadataDefault to set the default behavior for the creation of new JDOClass instances using methods JDOModel.createJDOClass(String) and JDOModel.getJDOClass(String) for which the caller doesn't explicitly specify whether to read XML metatdata or not.

Parameters:
loadXMLMetadataDefault - the default setting for whether to read XML metatdata in JDOModel's methods for JDOClass creation.

removeJDOModel

void removeJDOModel(JDOModel jdoModel)
                    throws ModelException
Removes the specified jdoModel from the JDOModel cache. Note, if there are multiple entries in the cache with the specified jdoModel as value, then all of them get removed. The method does not have an effect, if this factory does not have the specified jdoModel.

Parameters:
jdoModel - the JDOModel to be removed.
Throws:
ModelException
Since:
2.0

removeJDOModel

void removeJDOModel(JavaModel javaModel)
                    throws ModelException
Removes the JDOModel for the specified javaModel from the JDOModel cache. The method does not have an effect, if this factory does not have a JDOModel for the the specified javaModel.

Parameters:
javaModel - the javaModel used to find the JDOModel instance to be removed.
Throws:
ModelException
Since:
2.0


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.