org.eclipse.handly.model.adapter

## Class DefaultContentAdapter

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

- All Implemented Interfaces:
    IContentAdapter

      public class DefaultContentAdapter
      extends java.lang.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 and Description
    --- | ---
    `static IContentAdapter` | `INSTANCE` The sole instance of the default content adapter.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IElement` | `adapt(java.lang.Object element)` Returns the `IElement` that corresponds to the given element.
    `java.lang.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 Detail

    - #### INSTANCE

          public static final IContentAdapter INSTANCE

      The sole instance of the default content adapter.

  - ### Method Detail

    - #### adapt

          public IElement adapt(java.lang.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 java.lang.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

Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0