Package org.eclipse.emf.ecp.ide.spi.util
Class EcoreHelper
- java.lang.Object
-
- org.eclipse.emf.ecp.ide.spi.util.EcoreHelper
-
public final class EcoreHelper extends java.lang.Object
Helper methods for dealing with ecores.- Since:
- 1.13
- Author:
- Alexandra Buzila
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Object[]
getDefaultPackageRegistryContents()
static java.util.Set<java.lang.String>
getOtherRelatedWorkspacePaths(java.lang.String ecorePath)
Returns the path for all ecores for whichprotected static void
loadResource(java.lang.String ecorePath, org.eclipse.emf.ecore.resource.Resource resource)
Wraps loading aResource
in order to catch thrown IOExceptions and rethrow them with more informative messages.static void
registerEcore(java.lang.String ecorePath)
Put an ecore'sEPackage
into theEPackage.Registry
.static void
unregisterEcore(java.lang.String ecorePath)
Remove the ecore'sEPackage
from theEPackage.Registry
.
-
-
-
Method Detail
-
registerEcore
public static void registerEcore(java.lang.String ecorePath) throws java.io.IOException
Put an ecore'sEPackage
into theEPackage.Registry
. Subsequently, register all referenced ecores.- Parameters:
ecorePath
- - path to the ecore- Throws:
java.io.IOException
- if resource cannot be loaded
-
loadResource
protected static void loadResource(java.lang.String ecorePath, org.eclipse.emf.ecore.resource.Resource resource) throws java.io.IOException
Wraps loading aResource
in order to catch thrown IOExceptions and rethrow them with more informative messages.- Parameters:
ecorePath
- The path of the resource. Needed for informative messagesresource
- TheResource
to load- Throws:
java.io.IOException
- if the loading of the Resource fails
-
getOtherRelatedWorkspacePaths
public static java.util.Set<java.lang.String> getOtherRelatedWorkspacePaths(java.lang.String ecorePath)
Returns the path for all ecores for which
a) the given ecore is dependent on.
b) the uri is a platform resource URI, meaning the ecore is available in the workspace.
- Parameters:
ecorePath
- the path- Returns:
- the ecore nsuris
-
unregisterEcore
public static void unregisterEcore(java.lang.String ecorePath)
Remove the ecore'sEPackage
from theEPackage.Registry
. It also removes the packages of referenced ecores.- Parameters:
ecorePath
- - the path of the ecore to be removed.
-
getDefaultPackageRegistryContents
public static java.lang.Object[] getDefaultPackageRegistryContents()
- Returns:
- the EPackages which are registered in the EPackage registry by default (without the ones registered during runtime by the tooling).
-
-