Package org.eclipse.m2m.atl.core.emf
Class EMFExtractor
java.lang.Object
org.eclipse.m2m.atl.core.emf.EMFExtractor
- All Implemented Interfaces:
IExtractor
The EMF implementation of the
IExtractor
interface.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
extract
(EMFModel sourceModel, OutputStream target, String fileExtension, Map<String, Object> options) Extracts anEMFModel
to anOutputStream
.void
Extracts an IModel using the given options.void
Extracts an IModel using default options.void
Extracts an IModel using the given options.protected static void
recreateResourceIfNeeded
(EMFModel model, org.eclipse.emf.common.util.URI uri, String contentType, boolean contentTypeLookup) Recreates the resource in order to save in the correct format matching the file extension.
-
Constructor Details
-
EMFExtractor
public EMFExtractor()
-
-
Method Details
-
extract
public void extract(IModel sourceModel, String target, Map<String, Object> options) throws ATLCoreExceptionExtracts 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:
- File system Resource:
-
extract
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:
-
extract
public void extract(EMFModel sourceModel, OutputStream target, String fileExtension, Map<String, Object> options) throws ATLCoreExceptionExtracts 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, OutputStream target, Map<String, Object> options) throws ATLCoreExceptionExtracts 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:
-
recreateResourceIfNeeded
protected static void recreateResourceIfNeeded(EMFModel model, org.eclipse.emf.common.util.URI uri, 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
-