|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.ecore.util.ECrossReferenceAdapter
org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter
public class CrossReferenceAdapter
An adapter that maintains itself as an adapter for all contained objects. It
can be installed for an EObject
, a Resource
, or a
ResourceSet
.
This adapter maintain information on inverse references, resource imports, and resource exports.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.ECrossReferenceAdapter |
---|
org.eclipse.emf.ecore.util.ECrossReferenceAdapter.InverseCrossReferencer |
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter |
---|
org.eclipse.emf.common.notify.Adapter.Internal |
Field Summary |
---|
Fields inherited from class org.eclipse.emf.ecore.util.ECrossReferenceAdapter |
---|
inverseCrossReferencer, unloadedEObjects, unloadedResources |
Constructor Summary | |
---|---|
CrossReferenceAdapter()
Initializes me. |
|
CrossReferenceAdapter(boolean resolve)
Initializes me. |
Method Summary | |
---|---|
protected void |
exportAdded(org.eclipse.emf.ecore.resource.Resource referenced,
org.eclipse.emf.ecore.resource.Resource referencer)
Hook to be implemented by subclasses upon the establishment of a new export of the referenced resource to the
referencer . |
protected void |
exportRemoved(org.eclipse.emf.ecore.resource.Resource referenced,
org.eclipse.emf.ecore.resource.Resource referencer)
Hook to be implemented by subclasses upon the elimination of an export of the referenced resource to the referencer . |
static CrossReferenceAdapter |
getCrossReferenceAdapter(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Obtains the cross-reference adapter for the specified resource set, if necessary creating it and attaching it. |
static CrossReferenceAdapter |
getExistingCrossReferenceAdapter(org.eclipse.emf.common.notify.Notifier notifier)
Searches the adapter list of the given Notifier for a CrossReferenceAdapter. |
java.util.Set |
getExports(org.eclipse.emf.ecore.resource.Resource referenced)
Gets the exports of a resource. |
java.util.Set |
getImports(org.eclipse.emf.ecore.resource.Resource referencer)
Gets the imports of a resource. |
java.util.Set |
getInverseReferencers(org.eclipse.emf.ecore.EObject referenced,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EClass type)
Returns a Set of EObjects that reference the given EObject. |
java.util.Set |
getInverseReferencersCrossResource(org.eclipse.emf.ecore.EObject referenced,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EClass type)
Like the getInverseReferencers(EObject, EReference, EClass) method,
obtains referencing objects (optionally filtered by reference and type),
except that it additionally only considers references that are
changeable and can
reference other resources. |
java.util.Collection |
getInverseReferences(org.eclipse.emf.ecore.EObject eObject,
boolean _resolve)
|
java.util.Collection |
getInverseReferencesCrossResource(org.eclipse.emf.ecore.EObject eObject)
Like the ECrossReferenceAdapter.getInverseReferences(EObject) method,
obtains settings implementing references to the specified object,
except that it only considers references that are
changeable and can
reference other resources. |
java.util.Collection |
getInverseReferencesCrossResource(org.eclipse.emf.ecore.EObject eObject,
boolean resolve)
Like the getInverseReferences(EObject, boolean) method,
obtains settings implementing references to the specified object,
except that it only considers references that are
changeable and can
reference other resources. |
java.util.Set |
getNonNavigableInverseReferencers(org.eclipse.emf.ecore.EObject referenced,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EClass type)
Returns a Set of EObjects that reference the given EObject through a uni directional EReferences. |
protected void |
handleContainment(org.eclipse.emf.common.notify.Notification notification)
Extends the superclass method to handle the removal cases of containment, to tear down aggregate (resource-level) cross-references. |
protected void |
importAdded(org.eclipse.emf.ecore.resource.Resource referencer,
org.eclipse.emf.ecore.resource.Resource referenced)
Hook to be implemented by subclasses upon the establishment of a new import of the referenced resource by the
referencer . |
protected void |
importRemoved(org.eclipse.emf.ecore.resource.Resource referencer,
org.eclipse.emf.ecore.resource.Resource referenced)
Hook to be implemented by subclasses upon the elimination of an import of the referenced resource by the referencer . |
protected boolean |
isImportExportCapable(org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EObject owner)
Queries whether the specified reference, applied to the given owner object, is capable of establishing a resource import or export by virtue of being a mutable cross-resource reference. |
protected boolean |
resolve()
|
void |
selfAdapt(org.eclipse.emf.common.notify.Notification notification)
Updates imports and exports maps. |
void |
setTarget(org.eclipse.emf.common.notify.Notifier target)
|
void |
unsetTarget(org.eclipse.emf.common.notify.Notifier notifier)
|
void |
updateImportsAndExports(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject value,
boolean register)
Updates the imports and exports map for the specified eObject |
void |
updateImportsAndExportsForContents(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject value,
boolean register)
Updates the imports and exports map for the contents of the specified eObject |
Methods inherited from class org.eclipse.emf.ecore.util.ECrossReferenceAdapter |
---|
addAdapter, createInverseCrossReferencer, dump, getCrossReferenceAdapter, getInverseReferences, getNonNavigableInverseReferences, getNonNavigableInverseReferences, getTarget, handleCrossReference, isAdapterForType, isIncluded, notifyChanged, removeAdapter, resolveAll, resolveProxy, setTarget, setTarget, setTarget, unsetTarget, unsetTarget, unsetTarget |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CrossReferenceAdapter()
public CrossReferenceAdapter(boolean resolve)
resolve
- flag to determine if the proxies need to be resolvedMethod Detail |
---|
public void selfAdapt(org.eclipse.emf.common.notify.Notification notification)
selfAdapt
in class org.eclipse.emf.ecore.util.ECrossReferenceAdapter
notification
- the event notificationprotected void handleContainment(org.eclipse.emf.common.notify.Notification notification)
handleContainment
in class org.eclipse.emf.ecore.util.ECrossReferenceAdapter
public void updateImportsAndExports(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject value, boolean register)
resource
- a resourceeObject
- the specified eObjectregister
- boolean flag to indicate whether to register imports or
unregister importspublic void updateImportsAndExportsForContents(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject value, boolean register)
resource
- a resourceeObject
- the specified eObjectregister
- boolean flag to indicate whether to register imports or
unregister importspublic void setTarget(org.eclipse.emf.common.notify.Notifier target)
setTarget
in interface org.eclipse.emf.common.notify.Adapter
setTarget
in class org.eclipse.emf.ecore.util.ECrossReferenceAdapter
ECrossReferenceAdapter.setTarget(org.eclipse.emf.common.notify.Notifier)
public void unsetTarget(org.eclipse.emf.common.notify.Notifier notifier)
unsetTarget
in interface org.eclipse.emf.common.notify.Adapter.Internal
unsetTarget
in class org.eclipse.emf.ecore.util.ECrossReferenceAdapter
ECrossReferenceAdapter.unsetTarget(org.eclipse.emf.common.notify.Notifier)
public java.util.Set getImports(org.eclipse.emf.ecore.resource.Resource referencer)
referencer
- the resource to retrieve imports for
public java.util.Set getExports(org.eclipse.emf.ecore.resource.Resource referenced)
referenced
- the resource to retrieve exports for
protected void importAdded(org.eclipse.emf.ecore.resource.Resource referencer, org.eclipse.emf.ecore.resource.Resource referenced)
referenced
resource by the
referencer
. This implementation does nothing; subclasses
need not call super
.
referencer
- the referencing resource (doing the importing)referenced
- the resource that it referencesprotected void importRemoved(org.eclipse.emf.ecore.resource.Resource referencer, org.eclipse.emf.ecore.resource.Resource referenced)
referenced
resource by the referencer
.
This implementation does nothing; subclasses need not call
super
.
referencer
- the formerly referencing resource (doing the importing)referenced
- the resource that it had referencedprotected void exportAdded(org.eclipse.emf.ecore.resource.Resource referenced, org.eclipse.emf.ecore.resource.Resource referencer)
referenced
resource to the
referencer
. This implementation does nothing; subclasses
need not call super
.
referenced
- the resource being referenced (doing the exporting)referencer
- the referencing resourceprotected void exportRemoved(org.eclipse.emf.ecore.resource.Resource referenced, org.eclipse.emf.ecore.resource.Resource referencer)
referenced
resource to the referencer
.
This implementation does nothing; subclasses need not call
super
.
referenced
- the resource formerly being referenced (doing the exporting)referencer
- the formerly referencing resourcepublic java.util.Set getInverseReferencers(org.eclipse.emf.ecore.EObject referenced, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass type)
referenced
- the referenced EObjectreference
- the reference to find referencers on, null for any referencetype
- the type of the referencers, use null for any type
public java.util.Set getInverseReferencersCrossResource(org.eclipse.emf.ecore.EObject referenced, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass type)
getInverseReferencers(EObject, EReference, EClass)
method,
obtains referencing objects (optionally filtered by reference and type),
except that it additionally only considers references that are
changeable and can
reference other resources.
referenced
- the referenced EObjectreference
- the reference to find referencers on, null for any referencetype
- the type of the referencers, use null for any type
public java.util.Collection getInverseReferencesCrossResource(org.eclipse.emf.ecore.EObject eObject)
ECrossReferenceAdapter.getInverseReferences(EObject)
method,
obtains settings implementing references to the specified object,
except that it only considers references that are
changeable and can
reference other resources.
eObject
- the referenced EObject
EStructuralFeature.Setting
s on
potentially cross-resource referencespublic java.util.Set getNonNavigableInverseReferencers(org.eclipse.emf.ecore.EObject referenced, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass type)
referenced
- the referenced EObjectreference
- the reference to find referencers on, null for any referencetype
- the type of the referencers, use null for any type
public static CrossReferenceAdapter getExistingCrossReferenceAdapter(org.eclipse.emf.common.notify.Notifier notifier)
notifier
- the notifier to search
public static CrossReferenceAdapter getCrossReferenceAdapter(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
resourceSet
- the resource set
protected boolean resolve()
resolve
in class org.eclipse.emf.ecore.util.ECrossReferenceAdapter
public java.util.Collection getInverseReferences(org.eclipse.emf.ecore.EObject eObject, boolean _resolve)
getInverseReferences
in class org.eclipse.emf.ecore.util.ECrossReferenceAdapter
public java.util.Collection getInverseReferencesCrossResource(org.eclipse.emf.ecore.EObject eObject, boolean resolve)
getInverseReferences(EObject, boolean)
method,
obtains settings implementing references to the specified object,
except that it only considers references that are
changeable and can
reference other resources.
eObject
- the referenced EObjectresolve
- whether to resolve proxies or not
EStructuralFeature.Setting
s on
potentially cross-resource referencesprotected boolean isImportExportCapable(org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject owner)
A reference is considered to support resource imports and exports if all of the following apply:
reference
- a reference featureowner
- an object under consideration that defines this reference.
Subclasses may need to introspect the object or its EClass to further
refine their criteria
true
if this reference in the context of this
owner should be counted for resource imports and exports;
false, otherwise
|
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.