Class EMFExtractor

  • All Implemented Interfaces:
    IExtractor

    public class EMFExtractor
    extends java.lang.Object
    implements IExtractor
    The EMF implementation of the IExtractor 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 an EMFModel to an OutputStream.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EMFExtractor

        public EMFExtractor()
    • Method Detail

      • 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 an EMFModel to an OutputStream.
        Parameters:
        sourceModel - the EMFModel to extract
        target - the target OutputStream to extract the targetModel
        fileExtension - the target file extension: defines the output format, default "xmi"
        options - the extraction parameters
        Throws:
        ATLCoreException
      • 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 recreate
        uri - the target URI with the correct extension
        contentType - the content type of the resource to save
        contentTypeLookup - specify whether the Extractor should automatically resolve the EPackage content type
        Throws:
        ATLCoreException