Package org.eclipse.handly.model.adapter

# Class DefaultContentAdapter

java.lang.Object
org.eclipse.handly.model.adapter.DefaultContentAdapter

All Implemented Interfaces:
  `IContentAdapter`

public class DefaultContentAdapter extends Object implements IContentAdapter
A content adapter that is based on `IAdaptable` mechanism. For a given `IElement` the corresponding element is obtained from the `ICorrespondingElementProvider` the `IElement` adapts to.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final IContentAdapter`
  `INSTANCE`
  The sole instance of the default content adapter.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IElement`
  `adapt(Object element)`
  Returns the `IElement` that corresponds to the given element.
  `Object`
  `getCorrespondingElement(IElement element)`
  Returns the element that corresponds to the given `IElement`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### INSTANCE

    public static final IContentAdapter INSTANCE
    The sole instance of the default content adapter.

- ## Method Details

  - ### adapt

    public IElement adapt(Object element)
    Description copied from interface: `IContentAdapter`
    Returns the `IElement` that corresponds to the given element.
    Specified by:
      `adapt` in interface `IContentAdapter`
    Parameters:
      `element` - may be `null`
    Returns:
      the corresponding `IElement`, or `null` if none

  - ### getCorrespondingElement

    public Object getCorrespondingElement(IElement element)
    Description copied from interface: `IContentAdapter`
    Returns the element that corresponds to the given `IElement`.
    Specified by:
      `getCorrespondingElement` in interface `IContentAdapter`
    Parameters:
      `element` - an `IElement` (may be `null`)
    Returns:
      the corresponding element, or `null` if none