Package com.composum.sling.core
Class CoreAdapterFactory
- java.lang.Object
-
- com.composum.sling.core.CoreAdapterFactory
-
- All Implemented Interfaces:
org.apache.sling.api.adapter.AdapterFactory
public class CoreAdapterFactory extends Object implements org.apache.sling.api.adapter.AdapterFactory
- Author:
- Mirko Zeibig
-
-
Constructor Summary
Constructors Constructor Description CoreAdapterFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static <AdapterType>
AdapterTypegetAdapter(ResourceHandle resourceHandle, Class<AdapterType> type)
HandlesresourceHandle.adaptTo(ResourceHandle.class)
.<AdapterType>
AdapterTypegetAdapter(Object adaptable, Class<AdapterType> type)
protected static <AdapterType>
AdapterTypegetAdapter(org.apache.sling.api.resource.Resource resource, Class<AdapterType> type)
Handlesresource.adaptTo(ResourceHandle.class)
, to wrap a resource with an ResourceHandle.
-
-
-
Method Detail
-
getAdapter
public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type)
- Specified by:
getAdapter
in interfaceorg.apache.sling.api.adapter.AdapterFactory
- See Also:
AdapterFactory.getAdapter(java.lang.Object, java.lang.Class)
-
getAdapter
protected static <AdapterType> AdapterType getAdapter(ResourceHandle resourceHandle, Class<AdapterType> type)
HandlesresourceHandle.adaptTo(ResourceHandle.class)
.- Parameters:
resourceHandle
- Object to adapttype
- target type- Returns:
- original Object
-
getAdapter
protected static <AdapterType> AdapterType getAdapter(org.apache.sling.api.resource.Resource resource, Class<AdapterType> type)
Handlesresource.adaptTo(ResourceHandle.class)
, to wrap a resource with an ResourceHandle.- Parameters:
resource
- resource to adapt/wraptype
- target type- Returns:
- wrapped resource
-
-