## org.eclipse.emf.ecore.util
Class ECrossReferenceAdapter

    java.lang.Object
      org.eclipse.emf.ecore.util.ECrossReferenceAdapter

All Implemented Interfaces:
  Adapter, Adapter.Internal

    public class ECrossReferenceAdapter

extends java.lang.Object
implements Adapter.Internal

An adapter that maintains itself as an adapter for all contained objects. It can be installed for an `EObject`, a `Resource`, or a `ResourceSet`.

Since:
  2.2

Nested Class Summary
`protected class` `ECrossReferenceAdapter.InverseCrossReferencer`

Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
`Adapter.Internal`

Field Summary
`protected ECrossReferenceAdapter.InverseCrossReferencer` `inverseCrossReferencer`
`protected java.util.Map<EObject,Resource>` `unloadedEObjects`
`protected java.util.Set<Resource>` `unloadedResources`

Constructor Summary
`ECrossReferenceAdapter()`

Method Summary
`protected void` `addAdapter(Notifier notifier)`
`protected ECrossReferenceAdapter.InverseCrossReferencer` `createInverseCrossReferencer()`
`void` `dump()`
`static ECrossReferenceAdapter` `getCrossReferenceAdapter(Notifier notifier)` Returns the first `ECrossReferenceAdapter` in the notifier's `adapter list`, or `null`, if there isn't one.
`java.util.Collection<EStructuralFeature.Setting>` `getInverseReferences(EObject eObject)`
`java.util.Collection<EStructuralFeature.Setting>` `getInverseReferences(EObject eObject, boolean resolve)`
`java.util.Collection<EStructuralFeature.Setting>` `getNonNavigableInverseReferences(EObject eObject)`
`java.util.Collection<EStructuralFeature.Setting>` `getNonNavigableInverseReferences(EObject eObject, boolean resolve)`
`Notifier` `getTarget()` Returns the target from which the adapter receives notification.
`protected void` `handleContainment(Notification notification)` Handles a containment change by adding and removing the adapter as appropriate.
`protected void` `handleCrossReference(EReference reference, Notification notification)` Handles a cross reference change by adding and removing the adapter as appropriate.
`boolean` `isAdapterForType(java.lang.Object type)` Returns whether the adapter is of the given type.
`protected boolean` `isIncluded(EReference eReference)`
`void` `notifyChanged(Notification notification)` Handles a notification by calling `selfAdapter`.
`protected void` `removeAdapter(Notifier notifier)`
`protected boolean` `resolve()`
`protected void` `resolveAll(EObject eObject)`
`protected void` `resolveProxy(Resource resource, EObject eObject, EObject proxy, EStructuralFeature.Setting setting)`
`protected void` `selfAdapt(Notification notification)` Handles a notification by calling `handleContainment` for any containment-based notification.
`protected void` `setTarget(EObject target)` Handles installation of the adapter on an EObject by adding the adapter to each of the directly contained objects.
`void` `setTarget(Notifier target)` Handles installation of the adapter by adding the adapter to each of the directly contained objects.
`protected void` `setTarget(Resource target)` Handles installation of the adapter on a Resource by adding the adapter to each of the directly contained objects.
`protected void` `setTarget(ResourceSet target)` Handles installation of the adapter on a ResourceSet by adding the adapter to each of the directly contained objects.
`protected void` `unsetTarget(EObject target)` Handles undoing the installation of the adapter from an EObject by removing the adapter to each of the directly contained objects.
`void` `unsetTarget(Notifier target)` Handles undoing the installation of the adapter by removing the adapter to each of the directly contained objects.
`protected void` `unsetTarget(Resource target)` Handles undoing the installation of the adapter from a Resource by removing the adapter to each of the directly contained objects.
`protected void` `unsetTarget(ResourceSet target)` Handles undoing the installation of the adapter from a ResourceSet by removing the adapter to each of the directly contained objects.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### unloadedResources

    protected java.util.Set<Resource> unloadedResources

### unloadedEObjects

    protected java.util.Map<EObject,Resource> unloadedEObjects

### inverseCrossReferencer

    protected ECrossReferenceAdapter.InverseCrossReferencer inverseCrossReferencer

Constructor Detail

### ECrossReferenceAdapter

    public ECrossReferenceAdapter()

Method Detail

### getCrossReferenceAdapter

    public static ECrossReferenceAdapter getCrossReferenceAdapter(Notifier notifier)

  Returns the first `ECrossReferenceAdapter` in the notifier's `adapter list`, or `null`, if there isn't one.

  Parameters:
    `notifier` - the object to search.
  Returns:
    the first ECrossReferenceAdapter in the notifier's adapter list.

### getNonNavigableInverseReferences

    public java.util.Collection<EStructuralFeature.Setting> getNonNavigableInverseReferences(EObject eObject)

### getNonNavigableInverseReferences

    public java.util.Collection<EStructuralFeature.Setting> getNonNavigableInverseReferences(EObject eObject,
                                                                                             boolean resolve)

### getInverseReferences

    public java.util.Collection<EStructuralFeature.Setting> getInverseReferences(EObject eObject)

### getInverseReferences

    public java.util.Collection<EStructuralFeature.Setting> getInverseReferences(EObject eObject,
                                                                                 boolean resolve)

### resolveAll

    protected void resolveAll(EObject eObject)

### resolveProxy

    protected void resolveProxy(Resource resource,
                                EObject eObject,
                                EObject proxy,
                                EStructuralFeature.Setting setting)

### isIncluded

    protected boolean isIncluded(EReference eReference)

### createInverseCrossReferencer

    protected ECrossReferenceAdapter.InverseCrossReferencer createInverseCrossReferencer()

### notifyChanged

    public void notifyChanged(Notification notification)

  Handles a notification by calling `selfAdapter`.

  Specified by:
    `notifyChanged` in interface `Adapter`
  Parameters:
    `notification` - a description of the change.

### selfAdapt

    protected void selfAdapt(Notification notification)

  Handles a notification by calling `handleContainment` for any containment-based notification.

### handleContainment

    protected void handleContainment(Notification notification)

  Handles a containment change by adding and removing the adapter as appropriate.

### handleCrossReference

    protected void handleCrossReference(EReference reference,
                                        Notification notification)

  Handles a cross reference change by adding and removing the adapter as appropriate.

### setTarget

    public void setTarget(Notifier target)

  Handles installation of the adapter by adding the adapter to each of the directly contained objects.

  Specified by:
    `setTarget` in interface `Adapter`
  Parameters:
    `target` - the new notifier.
  See Also:
    `Adapter.getTarget()`

### setTarget

    protected void setTarget(EObject target)

  Handles installation of the adapter on an EObject by adding the adapter to each of the directly contained objects.

### setTarget

    protected void setTarget(Resource target)

  Handles installation of the adapter on a Resource by adding the adapter to each of the directly contained objects.

### setTarget

    protected void setTarget(ResourceSet target)

  Handles installation of the adapter on a ResourceSet by adding the adapter to each of the directly contained objects.

### unsetTarget

    public void unsetTarget(Notifier target)

  Handles undoing the installation of the adapter by removing the adapter to each of the directly contained objects.

  Specified by:
    `unsetTarget` in interface `Adapter.Internal`
  Parameters:
    `target` - the old notifier.
  See Also:
    `Adapter.getTarget()`, `Adapter.setTarget(Notifier)`

### unsetTarget

    protected void unsetTarget(EObject target)

  Handles undoing the installation of the adapter from an EObject by removing the adapter to each of the directly contained objects.

### unsetTarget

    protected void unsetTarget(Resource target)

  Handles undoing the installation of the adapter from a Resource by removing the adapter to each of the directly contained objects.

### unsetTarget

    protected void unsetTarget(ResourceSet target)

  Handles undoing the installation of the adapter from a ResourceSet by removing the adapter to each of the directly contained objects.

### addAdapter

    protected void addAdapter(Notifier notifier)

### removeAdapter

    protected void removeAdapter(Notifier notifier)

### dump

    public void dump()

### getTarget

    public Notifier getTarget()

  Description copied from interface: `Adapter`
  Returns the target from which the adapter receives notification. In general, an adapter may be shared by more than one notifier.

  Specified by:
    `getTarget` in interface `Adapter`
  Returns:
    the target notifier.
  See Also:
    `Adapter.setTarget(org.eclipse.emf.common.notify.Notifier)`

### isAdapterForType

    public boolean isAdapterForType(java.lang.Object type)

  Description copied from interface: `Adapter`
  Returns whether the adapter is of the given type. In general, an adapter may be the adapter for many types.

  Specified by:
    `isAdapterForType` in interface `Adapter`
  Parameters:
    `type` - the type.
  Returns:
    whether the adapter is of the given type.
  See Also:
    `AdapterFactory.isFactoryForType(java.lang.Object)`

### resolve

    protected boolean resolve()

Copyright 2001-2006 IBM Corporation and others. All Rights Reserved.