Package org.eclipse.m2m.atl.engine.vm
Class ModelLoader
java.lang.Object
org.eclipse.m2m.atl.engine.vm.ModelLoader
- Direct Known Subclasses:
EMFModelLoader
Model loading and saving facility. Must be extended by concrete implementations
such as for EMF or MDR. This is only used in command-line mode at the present time.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExtractor
(String prefix, Class ext) void
addInjector
(String prefix, Class inj) void
abstract ASMModel
getATL()
abstract ASMModel
getBuiltInMetaModel
(String name) abstract ASMModel
getMOF()
abstract ASMModel
loadModel
(String name, ASMModel metamodel, InputStream in) Loads a model with given name and metamodel from in.Loads a model from the URI represented by href.abstract ASMModel
Deprecated.protected abstract ASMModel
realLoadModel
(String name, ASMModel metamodel, String href) protected abstract void
void
Saves the model to a writable URL.protected abstract void
setParameter
(String name, Object value) abstract void
-
Field Details
-
loadedModels
-
-
Constructor Details
-
ModelLoader
public ModelLoader()
-
-
Method Details
-
addInjector
-
addExtractor
-
loadModel
public abstract ASMModel loadModel(String name, ASMModel metamodel, InputStream in) throws IOException Loads a model with given name and metamodel from in. Use this method only if there is no real URI available!- 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
-
realLoadModel
protected abstract ASMModel realLoadModel(String name, ASMModel metamodel, String href) throws IOException - Throws:
IOException
-
loadModel
Loads a model from the URI represented by href.- Parameters:
name
- The model name.metamodel
- The metamodel of the model to be loaded.href
- The model URI.- Returns:
- The loaded ASMModel.
- Throws:
IOException
-
inject
-
newModel
Deprecated.UsenewModel(String, String, ASMModel)
instead- Parameters:
name
-metamodel
-- Returns:
- A new ASMModel
-
newModel
- Parameters:
name
-uri
-metamodel
-- Returns:
- A new ASMModel
-
setParameter
-
realSave
- Throws:
IOException
-
save
Saves the model to a writable URL.- Parameters:
model
- The model to savehref
- The writable URL- Throws:
IOException
-
extract
-
getMOF
-
getATL
-
getBuiltInMetaModel
-
unload
-
newModel(String, String, ASMModel)
instead