public interface Adaptable
Adaptable objects can be dynamically extended to provide different interfaces (or "adapters"). Adapters are created by adapter factories, which are in turn managed by type by adapter managers.
For example,
IAdaptable a = [some adaptable]; IFoo x = a.getAdapter(IFoo.class); if (x != null) [do IFoo things with x]
This interface can be used without OSGi running.
Clients may implement this interface, or obtain a default implementation of this interface by subclassing
PlatformObject
.
AdapterFactory
,
AdapterManager
,
AdaptableObject
Modifier and Type | Method and Description |
---|---|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class associated with this object.
|
<T> T getAdapter(Class<T> adapter)
null
if no such object can be found.adapter
- the adapter class to look upnull
if this object does not have an adapter for
the given classCopyright © 2015 Nuxeo SA. All rights reserved.