Runtime

## org.eclipse.gmf.runtime.emf.core.util
Class EObjectAdapter

    java.lang.Object
      org.eclipse.gmf.runtime.common.core.util.Proxy
          org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter

All Implemented Interfaces:
  IAdaptable, IProxyEObject

Direct Known Subclasses:
  CanonicalEditPolicy.CanonicalElementAdapter

public class EObjectAdapter
extends Proxy
implements IAdaptable, IProxyEObject

Wraps an `EObject` to adapt it to the `IAdaptable` Eclipse platform API. This is useful for passing `EObject`s into APIs that consume adaptables.

See the `EObjectAdapter.getAdapter(Class)` method for the supported adaptations. Note that this implementation does not consult the Eclipse platform's adapter factory manager for registered adapters.

Note that this class is not intended to be extended by clients. Clients may instantiate it.

See Also:
  `EObjectAdapter.getAdapter(Class)`

Constructor Summary
`EObjectAdapter(EObject element)`

Method Summary
`java.lang.Object` `getAdapter(java.lang.Class adapter)` Returns the wrapped `EObject` as the adapter when possible.
`java.lang.Object` `getProxyClassID()` Obtains the ID (fully-qualified name) of the `EClass` of the proxy object.
`EObject` `resolve()` Resolves the proxy.

Methods inherited from class org.eclipse.gmf.runtime.common.core.util.Proxy
`equals, getRealObject, handle, hashCode, setRealObject`

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

Constructor Detail

### EObjectAdapter

    public EObjectAdapter(EObject element)

Method Detail

### getAdapter

    public java.lang.Object getAdapter(java.lang.Class adapter)

  Returns the wrapped `EObject` as the adapter when possible. The following adaptations are supported:
  - if the wrapped `EObject` conforms to the `adapter` type, then it is returned
  - if this adapter, itself, conforms to the `adapter` type, then it is returned
  - otherwise, there is no adapter (`null` returned)

  Specified by:
    `getAdapter` in interface `IAdaptable`

### getProxyClassID

    public final java.lang.Object getProxyClassID()

  Description copied from interface: `IProxyEObject`
  Obtains the ID (fully-qualified name) of the `EClass` of the proxy object.

  Specified by:
    `getProxyClassID` in interface `IProxyEObject`
  Returns:
    the `EClass` ID (must not be `null`)
  See Also:
    `ProxyUtil#getProxyClassID(EObject)`

### resolve

    public final EObject resolve()

  Description copied from interface: `IProxyEObject`
  Resolves the proxy.

  Specified by:
    `resolve` in interface `IProxyEObject`
  Returns:
    the resolved object, or `null` if the proxy could not be resolved
  See Also:
    `ProxyUtil#resolve(EObject)`

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.