|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil
public class EMFCoreUtil
Static utilities for working with EMF objects and resources in the GMF environment.
Constructor Summary | |
---|---|
EMFCoreUtil()
|
Method Summary | |
---|---|
static org.eclipse.emf.ecore.EObject |
create(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EClass eClass)
Creates an object at a given containment reference whose EClass is eClass. |
static org.eclipse.emf.ecore.EObject |
createProxy(org.eclipse.emf.ecore.EClass eClass,
org.eclipse.emf.common.util.URI uri)
Creates a proxy of the specified type with the specified proxy URI. |
static org.eclipse.emf.ecore.EObject |
getContainer(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EClass eClass)
Gets the first container with the specified EClass. |
static java.util.Collection |
getExports(org.eclipse.emf.ecore.resource.Resource resource)
Gets the exports of a resource. |
static java.util.Collection |
getImports(org.eclipse.emf.ecore.resource.Resource resource)
Gets the imports of a resource. |
static org.eclipse.emf.ecore.EObject |
getLeastCommonContainer(java.util.Collection objects,
org.eclipse.emf.ecore.EClass desiredContainerType)
Finds the first common container of a collection of objects. |
static java.lang.String |
getName(org.eclipse.emf.ecore.EObject eObject)
Gets the name of an object if the object has name, returns an empty string otherwise. |
static org.eclipse.emf.ecore.EClass |
getProxyClass(org.eclipse.emf.ecore.EObject proxy)
Gets the proxy class by parsing the proxy URI. |
static java.lang.String |
getProxyID(org.eclipse.emf.ecore.EObject proxy)
Gets the proxy ID by parsing the proxy URI. |
static java.lang.String |
getQualifiedName(org.eclipse.emf.ecore.EObject eObject,
boolean formatted)
Gets the fully qualified name of an object. |
static java.util.Collection |
getReferencers(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EReference[] features)
Uses a reverse reference map that is maintained by the MSL service to find all referencers of a particular element. |
static java.util.Collection |
getTransitiveExports(org.eclipse.emf.ecore.resource.Resource resource)
Gets the transitive closure of the exports of a resource. |
static java.util.Collection |
getTransitiveImports(org.eclipse.emf.ecore.resource.Resource resource)
Gets the transitive closure of the imports of a resource. |
static org.eclipse.emf.ecore.EObject |
resolve(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
org.eclipse.emf.ecore.EObject proxy)
Attempts to resolve the specified proxy object, returning
null (rather than the original proxy) if it is unresolvable. |
static void |
setName(org.eclipse.emf.ecore.EObject eObject,
java.lang.String name)
Sets the name of an object if the object can be assigned a name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EMFCoreUtil()
Method Detail |
---|
public static org.eclipse.emf.ecore.EObject create(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass eClass)
EClass
is eClass.
container
- The container of the new object.reference
- The feature containing the object.eClass
- The EClass
.
EObject
.public static org.eclipse.emf.ecore.EObject getContainer(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EClass eClass)
eObject
- The EObject
.eClass
- The eClass.
public static org.eclipse.emf.ecore.EObject getLeastCommonContainer(java.util.Collection objects, org.eclipse.emf.ecore.EClass desiredContainerType)
objects
- The EObject
s.desiredContainerType
- The desired EClass
of the container.
public static java.util.Collection getReferencers(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference[] features)
features
can be null.
eObject
- The referenced object.features
- The reference features.
public static java.util.Collection getImports(org.eclipse.emf.ecore.resource.Resource resource)
resource
has references.
resource
- a resource.
public static java.util.Collection getExports(org.eclipse.emf.ecore.resource.Resource resource)
resource
.
resource
- a resource.
public static java.util.Collection getTransitiveImports(org.eclipse.emf.ecore.resource.Resource resource)
resource
, the resources
that import those, etc.
resource
- a resource.
public static java.util.Collection getTransitiveExports(org.eclipse.emf.ecore.resource.Resource resource)
resource
, the resources
that export those, etc.
resource
- a resource.
public static java.lang.String getName(org.eclipse.emf.ecore.EObject eObject)
eObject
- The object.
public static void setName(org.eclipse.emf.ecore.EObject eObject, java.lang.String name)
eObject
- The object.name
- The object's new name.
java.lang.IllegalArgumentException
- if the eObject
does not
have a name attributepublic static java.lang.String getQualifiedName(org.eclipse.emf.ecore.EObject eObject, boolean formatted)
eObject
- The object.formatted
- if True, unnamed parents will be listed using their meta-class
name.
public static java.lang.String getProxyID(org.eclipse.emf.ecore.EObject proxy)
proxy
- The proxy object.
public static org.eclipse.emf.ecore.EClass getProxyClass(org.eclipse.emf.ecore.EObject proxy)
proxy
- The proxy object.
public static org.eclipse.emf.ecore.EObject createProxy(org.eclipse.emf.ecore.EClass eClass, org.eclipse.emf.common.util.URI uri)
classID
- The type of proxy to create.uri
- The URI for the new proxy.
public static org.eclipse.emf.ecore.EObject resolve(org.eclipse.emf.transaction.TransactionalEditingDomain domain, org.eclipse.emf.ecore.EObject proxy)
proxy
object, returning
null
(rather than the original proxy) if it is unresolvable.
domain
- Th editing domain.proxy
- The proxy object.
null
if not resolved
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.