Class EmfUml2PersistenceHelper


  • @OpenApi
    public final class EmfUml2PersistenceHelper
    extends com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
    Stores save and load options.
    • Constructor Detail

      • EmfUml2PersistenceHelper

        public EmfUml2PersistenceHelper​(java.lang.String resourcesJarPath,
                                        java.lang.String optionsDir,
                                        java.util.Set<java.lang.String> supportedUmlUris)
    • Method Detail

      • getSaveOptionsProvider

        @OpenApi
        public static PersistenceOptionsProvider getSaveOptionsProvider()
        Returns save options provider
        Returns:
        persistence options provider
      • setSaveOptionsProvider

        @OpenApi
        public static void setSaveOptionsProvider​(PersistenceOptionsProvider saveOptionsProvider)
        Sets save options provider.
      • getLoadOptionsProvider

        @OpenApi
        public static PersistenceOptionsProvider getLoadOptionsProvider()
        Returns load options provider.
        Returns:
        persistence options provider
      • addResourceSetInitializer

        @OpenApi
        public static void addResourceSetInitializer​(ResourceSetInitializer initializer)
        Register resource set initializer.
        Parameters:
        initializer - resource set initializer to add.
      • removeResourceSetInitializer

        @OpenApi
        public static void removeResourceSetInitializer​(ResourceSetInitializer initializer)
        Remove resource set initializer.
        Parameters:
        initializer - resource set initializer to remove.
      • getResourceSet

        public org.eclipse.emf_2_2_3.ecore.resource.ResourceSet getResourceSet()
      • setLoadOptionsProvider

        @OpenApi
        public static void setLoadOptionsProvider​(PersistenceOptionsProvider loadOptionsProvider)
        Sets load options provider.
      • createResource

        public org.eclipse.emf_2_2_3.ecore.resource.Resource createResource​(org.eclipse.emf_2_2_3.common.util.URI uri,
                                                                            org.eclipse.uml2_2_0_4.uml.Package ePackage)
      • save

        public void save​(org.eclipse.emf_2_2_3.ecore.resource.Resource resource)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • load

        public org.eclipse.uml2_2_0_4.uml.Package load​(java.lang.String resourceString)
      • loadFile

        public org.eclipse.uml2_2_0_4.uml.Package loadFile​(java.io.File file)
      • load

        private org.eclipse.uml2_2_0_4.uml.Package load​(org.eclipse.emf_2_2_3.common.util.URI uri)
      • createURI

        public static org.eclipse.emf_2_2_3.common.util.URI createURI​(org.eclipse.emf_2_2_3.common.util.URI path,
                                                                      java.lang.String name,
                                                                      java.lang.String extension)
      • registerResourceFactories

        protected void registerResourceFactories()
        Specified by:
        registerResourceFactories in class com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
      • getPackageInstance

        protected java.lang.Object getPackageInstance()
        Specified by:
        getPackageInstance in class com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
      • getPackageRegistry

        protected java.util.Map getPackageRegistry()
        Specified by:
        getPackageRegistry in class com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
      • registerPathmaps

        protected void registerPathmaps​(java.lang.String resourcesJarPath)
        Specified by:
        registerPathmaps in class com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
      • getUri

        private static org.eclipse.emf_2_2_3.common.util.URI getUri​(org.eclipse.emf_2_2_3.common.util.URI base,
                                                                    java.lang.String what)
      • clean

        public void clean​(ProgressStatus progress)
        Specified by:
        clean in class com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
      • clean

        @OpenApi
        public static void clean​(java.util.Collection elements,
                                 ProgressStatus progress)
        Disposes given Eclipse UML2 elements.
        Parameters:
        elements - Eclipse UML2 elements.
        progress - progress
      • cleanResourceSet

        private static void cleanResourceSet​(org.eclipse.emf_2_2_3.ecore.resource.ResourceSet resourceSet,
                                             ProgressStatus progress)