|
TPTP 4.6.0 Platform Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.hyades.models.hierarchy.util.EMFUtil
org.eclipse.tptp.platform.common.internal.util.EMFUtil
public class EMFUtil
Contains generic utility methods to work with EMF objects.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.hyades.models.hierarchy.util.EMFUtil |
|---|
org.eclipse.hyades.models.hierarchy.util.EMFUtil.EqualityHelperIgnoreContainer, org.eclipse.hyades.models.hierarchy.util.EMFUtil.ReusableValuesAdapter |
| Field Summary | |
|---|---|
static java.util.Map |
RESOURCE_OPTIONS
|
| Constructor Summary | |
|---|---|
EMFUtil()
|
|
| Method Summary | |
|---|---|
static void |
addAdapter(java.util.Iterator objectIterator,
org.eclipse.emf.common.notify.Adapter adapter)
Adds the specified adapter to the notifiers in the given iterator. |
static org.eclipse.emf.ecore.EObject |
getEObject(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.emf.ecore.EObject eObject,
boolean load)
Returns an EObject from the resource set that has the same URI fragment or id of the specifie eObject. |
static org.eclipse.emf.ecore.EObject[] |
getEObjects(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
Returns the EObjects in the specified file from the Resource Set without loading it. |
static org.eclipse.emf.ecore.EObject[] |
getEObjects(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
java.lang.String fullPath)
Returns the EObjects in the specified file paht from the Resource Set without loading it. |
static org.eclipse.emf.ecore.resource.Resource |
getResource(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
Returns a resource without loading it. |
static org.eclipse.emf.ecore.resource.Resource.Factory |
getResourceFactory(java.lang.String fileExtension)
Returns the resource factory associated with a given file extension. |
static org.eclipse.emf.ecore.resource.Resource[] |
getResources(org.eclipse.core.runtime.IPath fullPath,
org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Returns an array of EMF resources from the resource set passed by @param resourceSet that are in the file path specified by @param fullPath |
static org.eclipse.core.resources.IFile |
getWorkspaceFile(org.eclipse.emf.ecore.EObject eObject)
Returns the workspace file that is storing a given eObject or null if the object is not persisted. |
static org.eclipse.core.resources.IFile |
getWorkspaceFile(org.eclipse.emf.ecore.resource.Resource resource)
Returns the workspace file that corresponds to a given resource or null if the resource is not available in the
workspace. |
static java.lang.String |
getWorkspaceFilePath(org.eclipse.emf.ecore.resource.Resource resource)
|
static org.eclipse.emf.ecore.EObject[] |
load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
Loads the specified file returning all the root EObjects. |
static org.eclipse.emf.ecore.EObject[] |
load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
java.lang.String fullPath)
Loads the specified file returning all the root EObjects. |
static org.eclipse.emf.ecore.EObject |
reload(org.eclipse.emf.ecore.EObject eObject)
Reloads a given eObject returning a new instance from the same resource. |
static org.eclipse.emf.ecore.resource.Resource[] |
remove(org.eclipse.emf.ecore.EObject eObject)
Removes the specified eObject from its container and breaks all the references to this object within the context of its resource set. |
static org.eclipse.emf.ecore.resource.Resource[] |
remove(org.eclipse.emf.ecore.resource.Resource resource)
Removes the specified resource from its resource set and breaks all the references to objects inside this resource within the context of the resource set. |
static void |
removeAdapter(java.util.Iterator objectIterator,
org.eclipse.emf.common.notify.Adapter adapter)
Removes the specified adapter from the notifiers in the given iterator. |
static void |
removeAdapters(java.util.Iterator objectIterator)
Removes all adapters from the notifiers in the given iterator. |
static void |
save(org.eclipse.emf.ecore.resource.Resource resource)
Saves a resource. |
| Methods inherited from class org.eclipse.hyades.models.hierarchy.util.EMFUtil |
|---|
containsObjectUsingSpecialEqual, convertToProxy, delete, delete, delete, delete, delete, delete, getAddReusableValue, getResourceSetRoots, isContainedIn, isContainedIn, isContainedIn, processObjectReferences, unload, unload, unsetAllFeatures, unsetFeaturesInSameResource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Map RESOURCE_OPTIONS
| Constructor Detail |
|---|
public EMFUtil()
| Method Detail |
|---|
public static void save(org.eclipse.emf.ecore.resource.Resource resource)
throws java.lang.Exception
resource - progressMonitor -
java.lang.IllegalArgumentException - if the resource is null
java.lang.Exception - if an exception happens during the saving attempt.
public static org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.emf.ecore.EObject eObject,
boolean load)
null.
resourceSet - eObject - load -
public static org.eclipse.emf.ecore.EObject[] getEObjects(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
If the resource set is null or if the file is not loaded
into it, this method returns an empty array.
resourceSet - file -
public static org.eclipse.emf.ecore.EObject[] getEObjects(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
java.lang.String fullPath)
If the resource set is null or if the file is not loaded
into it, this method returns an empty array.
resourceSet - file -
public static org.eclipse.emf.ecore.EObject[] load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
null then this method tries
to find a registered resource factory.
If the load attempt fails this method adds an entry to the log and returns an empty array.
resourceSet - file -
public static org.eclipse.emf.ecore.EObject[] load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
java.lang.String fullPath)
null then this method tries
to find a registered resource factory.
If the load attempt fails this method adds an entry to the log and returns an empty array.
resourceSet - fullPath -
public static org.eclipse.emf.ecore.resource.Resource.Factory getResourceFactory(java.lang.String fileExtension)
null or if there isn't a specifc
factory for the file extension, the this method returns the generic
factory.
fileExtension -
null if none.public static org.eclipse.core.resources.IFile getWorkspaceFile(org.eclipse.emf.ecore.EObject eObject)
null if the object is not persisted.
eObject -
public static org.eclipse.core.resources.IFile getWorkspaceFile(org.eclipse.emf.ecore.resource.Resource resource)
null if the resource is not available in the
workspace.
resource -
public static java.lang.String getWorkspaceFilePath(org.eclipse.emf.ecore.resource.Resource resource)
public static org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
null,
a new resource is created if a resource factory is available for the file
extension.
resourceSet - file -
public static org.eclipse.emf.ecore.EObject reload(org.eclipse.emf.ecore.EObject eObject)
This method unloads and reloads the entire eObject's resource and tries to find the object in the new resource content.
Important: after reloading the resource all the objects in that resource are reinstantiated. This has a big impact if an object is being cached somewhere.
eObject -
public static org.eclipse.emf.ecore.resource.Resource[] remove(org.eclipse.emf.ecore.EObject eObject)
eObject -
public static org.eclipse.emf.ecore.resource.Resource[] remove(org.eclipse.emf.ecore.resource.Resource resource)
resource -
public static void addAdapter(java.util.Iterator objectIterator,
org.eclipse.emf.common.notify.Adapter adapter)
objectIterator - adapter -
public static void removeAdapter(java.util.Iterator objectIterator,
org.eclipse.emf.common.notify.Adapter adapter)
objectIterator - adapter - public static void removeAdapters(java.util.Iterator objectIterator)
objectIterator -
public static org.eclipse.emf.ecore.resource.Resource[] getResources(org.eclipse.core.runtime.IPath fullPath,
org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
resourceSet - fullPath -
|
TPTP 4.6.0 Platform Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||