Package org.eclipse.m2m.atl.core.emf
Class EMFExtractor
- java.lang.Object
-
- org.eclipse.m2m.atl.core.emf.EMFExtractor
-
- All Implemented Interfaces:
IExtractor
public class EMFExtractor extends java.lang.Object implements IExtractor
The EMF implementation of theIExtractor
interface.
-
-
Constructor Summary
Constructors Constructor Description EMFExtractor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extract(EMFModel sourceModel, java.io.OutputStream target, java.lang.String fileExtension, java.util.Map<java.lang.String,java.lang.Object> options)
Extracts anEMFModel
to anOutputStream
.void
extract(IModel sourceModel, java.io.OutputStream target, java.util.Map<java.lang.String,java.lang.Object> options)
Extracts an IModel using the given options.void
extract(IModel sourceModel, java.lang.String target)
Extracts an IModel using default options.void
extract(IModel sourceModel, java.lang.String target, java.util.Map<java.lang.String,java.lang.Object> options)
Extracts an IModel using the given options.protected static void
recreateResourceIfNeeded(EMFModel model, org.eclipse.emf.common.util.URI uri, java.lang.String contentType, boolean contentTypeLookup)
Recreates the resource in order to save in the correct format matching the file extension.
-
-
-
Method Detail
-
extract
public void extract(IModel sourceModel, java.lang.String target, java.util.Map<java.lang.String,java.lang.Object> options) throws ATLCoreException
Extracts an IModel using the given options. Below the target parameter semantic.- File system Resource:
file:/path
- Workspace Resource:
platform:/resource/path
- Specified by:
extract
in interfaceIExtractor
- Parameters:
sourceModel
- the IModel to extracttarget
- the target indication to extract the targetModeloptions
- the extraction parameters- Throws:
ATLCoreException
- See Also:
IExtractor.extract(org.eclipse.m2m.atl.core.IModel, java.lang.String, java.util.Map)
- File system Resource:
-
extract
public void extract(IModel sourceModel, java.lang.String target) throws ATLCoreException
Extracts an IModel using default options.- Specified by:
extract
in interfaceIExtractor
- Parameters:
sourceModel
- the IModel to extracttarget
- the target indication to extract the targetModel- Throws:
ATLCoreException
- See Also:
IExtractor.extract(org.eclipse.m2m.atl.core.IModel, java.lang.String)
-
extract
public void extract(EMFModel sourceModel, java.io.OutputStream target, java.lang.String fileExtension, java.util.Map<java.lang.String,java.lang.Object> options) throws ATLCoreException
Extracts anEMFModel
to anOutputStream
.- Parameters:
sourceModel
- theEMFModel
to extracttarget
- the targetOutputStream
to extract the targetModelfileExtension
- the target file extension: defines the output format, default "xmi"options
- the extraction parameters- Throws:
ATLCoreException
-
extract
public void extract(IModel sourceModel, java.io.OutputStream target, java.util.Map<java.lang.String,java.lang.Object> options) throws ATLCoreException
Extracts an IModel using the given options.- Specified by:
extract
in interfaceIExtractor
- Parameters:
sourceModel
- the IModel to extracttarget
- theOutputStream
where to extract the targetModeloptions
- the extraction parameters- Throws:
ATLCoreException
- See Also:
IExtractor.extract(org.eclipse.m2m.atl.core.IModel, java.io.OutputStream, java.util.Map)
-
recreateResourceIfNeeded
protected static void recreateResourceIfNeeded(EMFModel model, org.eclipse.emf.common.util.URI uri, java.lang.String contentType, boolean contentTypeLookup) throws ATLCoreException
Recreates the resource in order to save in the correct format matching the file extension.- Parameters:
model
- the model to recreateuri
- the targetURI
with the correct extensioncontentType
- the content type of the resource to savecontentTypeLookup
- specify whether the Extractor should automatically resolve the EPackage content type- Throws:
ATLCoreException
-
-