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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidextract(EMFModel sourceModel, OutputStream target, String fileExtension, Map<String, Object> options) Extracts anEMFModelto anOutputStream.voidExtracts an IModel using the given options.voidExtracts an IModel using default options.voidExtracts an IModel using the given options.protected static voidrecreateResourceIfNeeded(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:
extractin 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:
extractin 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 anEMFModelto anOutputStream.- Parameters:
sourceModel- theEMFModelto extracttarget- the targetOutputStreamto 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:
extractin interfaceIExtractor- Parameters:
sourceModel- the IModel to extracttarget- theOutputStreamwhere 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 targetURIwith the correct extensioncontentType- the content type of the resource to savecontentTypeLookup- specify whether the Extractor should automatically resolve the EPackage content type- Throws:
ATLCoreException
-