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 java.lang.Object implements IContentAdapter
A content adapter that is based onIAdaptable
mechanism. For a givenIElement
the corresponding element is obtained from theICorrespondingElementProvider
theIElement
adapts to.
-
-
Field Summary
Fields Modifier and Type Field Description static IContentAdapter
INSTANCE
The sole instance of the default content adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IElement
adapt(java.lang.Object element)
Returns theIElement
that corresponds to the given element.java.lang.Object
getCorrespondingElement(IElement element)
Returns the element that corresponds to the givenIElement
.
-
-
-
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 theIElement
that corresponds to the given element.- Specified by:
adapt
in interfaceIContentAdapter
- Parameters:
element
- may benull
- Returns:
- the corresponding
IElement
, ornull
if none
-
getCorrespondingElement
public java.lang.Object getCorrespondingElement(IElement element)
Description copied from interface:IContentAdapter
Returns the element that corresponds to the givenIElement
.- Specified by:
getCorrespondingElement
in interfaceIContentAdapter
- Parameters:
element
- anIElement
(may benull
)- Returns:
- the corresponding element, or
null
if none
-
-