Class EmfUml2PersistenceHelper
- java.lang.Object
-
- com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
-
- com.nomagic.magicdraw.emfuml2xmi.v2.EmfUml2PersistenceHelper
-
@OpenApi public final class EmfUml2PersistenceHelper extends com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
Stores save and load options.
-
-
Field Summary
Fields Modifier and Type Field Description private static PersistenceOptionsProvider
loadOptionsProvider
private org.eclipse.emf_2_2_3.ecore.resource.ResourceSet
resourceSet
private static java.util.Collection<ResourceSetInitializer>
resourceSetInitializers
private static PersistenceOptionsProvider
saveOptionsProvider
-
Constructor Summary
Constructors Constructor Description EmfUml2PersistenceHelper(java.lang.String resourcesJarPath, java.lang.String optionsDir, java.util.Set<java.lang.String> supportedUmlUris)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addResourceSetInitializer(ResourceSetInitializer initializer)
Register resource set initializer.void
clean(ProgressStatus progress)
static void
clean(java.util.Collection elements, ProgressStatus progress)
Disposes given Eclipse UML2 elements.private static void
cleanResourceSet(org.eclipse.emf_2_2_3.ecore.resource.ResourceSet resourceSet, ProgressStatus progress)
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)
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)
static PersistenceOptionsProvider
getLoadOptionsProvider()
Returns load options provider.protected java.lang.Object
getPackageInstance()
protected java.util.Map
getPackageRegistry()
org.eclipse.emf_2_2_3.ecore.resource.ResourceSet
getResourceSet()
static PersistenceOptionsProvider
getSaveOptionsProvider()
Returns save options providerprivate 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)
org.eclipse.uml2_2_0_4.uml.Package
load(java.lang.String resourceString)
private org.eclipse.uml2_2_0_4.uml.Package
load(org.eclipse.emf_2_2_3.common.util.URI uri)
org.eclipse.uml2_2_0_4.uml.Package
loadFile(java.io.File file)
protected void
registerPathmaps(java.lang.String resourcesJarPath)
protected void
registerResourceFactories()
static void
removeResourceSetInitializer(ResourceSetInitializer initializer)
Remove resource set initializer.void
save(org.eclipse.emf_2_2_3.ecore.resource.Resource resource)
static void
setLoadOptionsProvider(PersistenceOptionsProvider loadOptionsProvider)
Sets load options provider.static void
setSaveOptionsProvider(PersistenceOptionsProvider saveOptionsProvider)
Sets save options provider.
-
-
-
Field Detail
-
saveOptionsProvider
private static PersistenceOptionsProvider saveOptionsProvider
-
loadOptionsProvider
private static PersistenceOptionsProvider loadOptionsProvider
-
resourceSetInitializers
private static final java.util.Collection<ResourceSetInitializer> resourceSetInitializers
-
resourceSet
private org.eclipse.emf_2_2_3.ecore.resource.ResourceSet resourceSet
-
-
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 classcom.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
-
getPackageInstance
protected java.lang.Object getPackageInstance()
- Specified by:
getPackageInstance
in classcom.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
-
getPackageRegistry
protected java.util.Map getPackageRegistry()
- Specified by:
getPackageRegistry
in classcom.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
-
registerPathmaps
protected void registerPathmaps(java.lang.String resourcesJarPath)
- Specified by:
registerPathmaps
in classcom.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 classcom.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)
-
-