|
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 EObject |
create(EObject container,
EReference reference,
EClass eClass)
Creates an object at a given containment reference whose EClass is eClass. |
static EObject |
createProxy(EClass eClass,
URI uri)
Creates a proxy of the specified type with the specified proxy URI. |
static EObject |
getContainer(EObject eObject,
EClass eClass)
Gets the first container with the specified EClass. |
static java.util.Collection |
getExports(Resource resource)
Gets the exports of a resource. |
static java.util.Collection |
getImports(Resource resource)
Gets the imports of a resource. |
static EObject |
getLeastCommonContainer(java.util.Collection objects,
EClass desiredContainerType)
Finds the first common container of a collection of objects. |
static java.lang.String |
getName(EObject eObject)
Gets the name of an object if the object has name, returns an empty string otherwise. |
static EClass |
getProxyClass(EObject proxy)
Gets the proxy class by parsing the proxy URI. |
static java.lang.String |
getProxyID(EObject proxy)
Gets the proxy ID by parsing the proxy URI. |
static java.lang.String |
getQualifiedName(EObject eObject,
boolean formatted)
Gets the fully qualified name of an object. |
static java.util.Collection |
getReferencers(EObject eObject,
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(Resource resource)
Gets the transitive closure of the exports of a resource. |
static java.util.Collection |
getTransitiveImports(Resource resource)
Gets the transitive closure of the imports of a resource. |
static EObject |
resolve(TransactionalEditingDomain domain,
EObject proxy)
Attempts to resolve the specified proxy object, returning
null (rather than the original proxy) if it is unresolvable. |
static void |
setName(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 EObject create(EObject container,
EReference reference,
EClass eClass)
EClass is eClass.
container - The container of the new object.reference - The feature containing the object.eClass - The EClass.
EObject.
public static EObject getContainer(EObject eObject,
EClass eClass)
eObject - The EObject.eClass - The eClass.
public static EObject getLeastCommonContainer(java.util.Collection objects,
EClass desiredContainerType)
objects - The EObjects.desiredContainerType - The desired EClass of the container.
public static java.util.Collection getReferencers(EObject eObject,
EReference[] features)
features can be null.
eObject - The referenced object.features - The reference features.
public static java.util.Collection getImports(Resource resource)
resource has references.
resource - a resource.
public static java.util.Collection getExports(Resource resource)
resource.
resource - a resource.
public static java.util.Collection getTransitiveImports(Resource resource)
resource, the resources
that import those, etc.
resource - a resource.
public static java.util.Collection getTransitiveExports(Resource resource)
resource, the resources
that export those, etc.
resource - a resource.
public static java.lang.String getName(EObject eObject)
eObject - The object.
public static void setName(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 attribute
public static java.lang.String getQualifiedName(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(EObject proxy)
proxy - The proxy object.
public static EClass getProxyClass(EObject proxy)
proxy - The proxy object.
public static EObject createProxy(EClass eClass,
URI uri)
classID - The type of proxy to create.uri - The URI for the new proxy.
public static EObject resolve(TransactionalEditingDomain domain,
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.