Class EMFModelLoader
java.lang.Object
org.eclipse.m2m.atl.engine.vm.ModelLoader
org.eclipse.m2m.atl.drivers.emf4atl.EMFModelLoader
- Direct Known Subclasses:
UMLModelLoader
Loads EMF models into a
ResourceSet
. Make sure to use the same model loader for all EMF models used
in a model transformation! Use different model loaders for different threads.-
Field Summary
Modifier and TypeFieldDescriptionprotected static ASMModel
protected Map
protected static org.osgi.framework.Bundle
protected String
protected static org.eclipse.emf.common.util.URI
protected boolean
protected org.eclipse.emf.ecore.resource.ResourceSet
protected Map
protected boolean
Fields inherited from class org.eclipse.m2m.atl.engine.vm.ModelLoader
loadedModels
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
adaptMetamodel
(ASMEMFModel model, ASMEMFModel metamodel) Adapts model if its metamodel is MOF, such that its NsURI is registered and primitive datatypes are mapped to Java types.protected ASMEMFModel
createASMEMFModel
(String name, org.eclipse.emf.ecore.resource.Resource extent, ASMModel metamodel, boolean isTarget) Creates a newASMEMFModel
.protected void
finalize()
protected void
finalizeResource
(org.eclipse.emf.ecore.resource.Resource r) Finalizes r.getATL()
getBuiltInMetaModel
(String name) getMOF()
org.eclipse.emf.ecore.resource.ResourceSet
Returns the internalResourceSet
that contains all models explicitly loaded by this loader.loadModel
(String name, ASMModel metamodel, InputStream in) Loads a model with given name and metamodel from in.Loads anASMEMFModel
with the given name, metamodel and uri.Deprecated.protected ASMModel
realLoadModel
(String name, ASMModel metamodel, String href) protected void
protected void
setParameter
(String name, Object value) void
Methods inherited from class org.eclipse.m2m.atl.engine.vm.ModelLoader
addExtractor, addInjector, extract, inject, loadModel, save
-
Field Details
-
bundle
protected static org.osgi.framework.Bundle bundle -
mofURI
protected static org.eclipse.emf.common.util.URI mofURI -
atlmm
-
resourceSet
protected org.eclipse.emf.ecore.resource.ResourceSet resourceSet -
bimm
-
useIDs
protected boolean useIDs -
removeIDs
protected boolean removeIDs -
encoding
-
saveOptions
-
-
Constructor Details
-
EMFModelLoader
public EMFModelLoader()EMFModelLoader constructor.
-
-
Method Details
-
getResourceSet
public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()Returns the internalResourceSet
that contains all models explicitly loaded by this loader.- Returns:
- The internal
ResourceSet
.
-
getMOF
- Specified by:
getMOF
in classModelLoader
- See Also:
-
getATL
- Specified by:
getATL
in classModelLoader
- See Also:
-
createASMEMFModel
protected ASMEMFModel createASMEMFModel(String name, org.eclipse.emf.ecore.resource.Resource extent, ASMModel metamodel, boolean isTarget) Creates a newASMEMFModel
.- Parameters:
name
- the model nameextent
- the resource extentmetamodel
- the metamodelisTarget
- true if the model is a target model- Returns:
- a new ASMEMFModel with this ModelLoader.
-
loadModel
Loads a model with given name and metamodel from in. Use this method only if there is no real URI available!- Specified by:
loadModel
in classModelLoader
- Parameters:
name
- The model name.metamodel
- The metamodel of the model to be loaded.in
- The input stream from which to load.- Returns:
- The loaded ASMModel.
- Throws:
IOException
- See Also:
-
loadModel
public ASMEMFModel loadModel(String name, ASMModel metamodel, org.eclipse.emf.common.util.URI uri) throws IOException Loads anASMEMFModel
with the given name, metamodel and uri.- Parameters:
name
- The name of the model to load.metamodel
- The metamodel for the model to load.uri
- The URI to load the model from.- Returns:
- The loaded model.
- Throws:
IOException
-
realLoadModel
- Specified by:
realLoadModel
in classModelLoader
- See Also:
-
newModel
Deprecated.- Specified by:
newModel
in classModelLoader
- Returns:
- A new ASMModel
- See Also:
-
newModel
- Overrides:
newModel
in classModelLoader
- Returns:
- A new ASMModel
- See Also:
-
getBuiltInMetaModel
- Specified by:
getBuiltInMetaModel
in classModelLoader
- See Also:
-
setParameter
- Specified by:
setParameter
in classModelLoader
- See Also:
-
realSave
- Specified by:
realSave
in classModelLoader
- Throws:
IOException
- See Also:
-
adaptMetamodel
Adapts model if its metamodel is MOF, such that its NsURI is registered and primitive datatypes are mapped to Java types.- Parameters:
model
- The model to adapt.metamodel
- The model's metamodel.- Throws:
IOException
-
finalize
-
finalizeResource
protected void finalizeResource(org.eclipse.emf.ecore.resource.Resource r) Finalizes r. This implementation does nothing, but allows for overriding in subclasses.- Parameters:
r
- TheResource
to finalize.
-
unload
- Specified by:
unload
in classModelLoader
- See Also:
-