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 theIExtractorinterface.
-
-
Constructor Summary
Constructors Constructor Description EMFExtractor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidextract(EMFModel sourceModel, java.io.OutputStream target, java.lang.String fileExtension, java.util.Map<java.lang.String,java.lang.Object> options)Extracts anEMFModelto anOutputStream.voidextract(IModel sourceModel, java.io.OutputStream target, java.util.Map<java.lang.String,java.lang.Object> options)Extracts an IModel using the given options.voidextract(IModel sourceModel, java.lang.String target)Extracts an IModel using default options.voidextract(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 voidrecreateResourceIfNeeded(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:
extractin 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:
extractin 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 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, 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:
extractin interfaceIExtractor- Parameters:
sourceModel- the IModel to extracttarget- theOutputStreamwhere 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 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
-
-