|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.sling.api.adapter.SlingAdaptable
public abstract class SlingAdaptable
The SlingAdaptable
class is an (abstract) default
implementation of the Adaptable
interface. It just uses the
default AdapterManager
implemented
to adapt itself to the requested type.
Extensions of this class may overwrite the adaptTo(Class)
method
using their own knowledge of adapters and may call this base class
implementation to fall back to an extended adapters.
Constructor Summary | |
---|---|
SlingAdaptable()
|
Method Summary | ||
---|---|---|
|
adaptTo(Class<AdapterType> type)
Adapts the adaptable to another type. |
|
static void |
setAdapterManager(AdapterManager adapterMgr)
Set the adapter manager to be used by a synthetic resource. |
|
static void |
unsetAdapterManager(AdapterManager adapterMgr)
Unset an adapter manager previously set with setAdapterManager(AdapterManager) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SlingAdaptable()
Method Detail |
---|
public static void setAdapterManager(AdapterManager adapterMgr)
adaptTo(Class)
method of a synthetic resource.
adapterMgr
- The adapter manager.public static void unsetAdapterManager(AdapterManager adapterMgr)
setAdapterManager(AdapterManager)
. If this method is called with
an AdapterManager
different from the currently set one it
has no effect.
adapterMgr
- The adapter managerpublic <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
Adaptable
adaptTo
in interface Adaptable
AdapterType
- The generic type to which this resource is adapted
totype
- The Class object of the target type, such as
Node.class
null
if the resource cannot
adapt to the requested typeAdaptable.adaptTo(java.lang.Class)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |