Class 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 Detail

      • CoreAdapterFactory

        public CoreAdapterFactory()
    • Method Detail

      • getAdapter

        public <AdapterType> AdapterType getAdapter​(Object adaptable,
                                                    Class<AdapterType> type)
        Specified by:
        getAdapter in interface org.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)
        Handles resourceHandle.adaptTo(ResourceHandle.class).
        Parameters:
        resourceHandle - Object to adapt
        type - target type
        Returns:
        original Object
      • getAdapter

        protected static <AdapterType> AdapterType getAdapter​(org.apache.sling.api.resource.Resource resource,
                                                              Class<AdapterType> type)
        Handles resource.adaptTo(ResourceHandle.class), to wrap a resource with an ResourceHandle.
        Parameters:
        resource - resource to adapt/wrap
        type - target type
        Returns:
        wrapped resource