org.apache.sling.jcr.resource.internal.helper
Class WrappedResourceProvider

java.lang.Object
  extended by org.apache.sling.jcr.resource.internal.helper.WrappedResourceProvider
All Implemented Interfaces:
ResourceProvider

public class WrappedResourceProvider
extends Object
implements ResourceProvider


Field Summary
 
Fields inherited from interface org.apache.sling.api.resource.ResourceProvider
RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME
 
Constructor Summary
WrappedResourceProvider(ResourceProvider resourceProvider, Comparable<?> serviceReference)
           
 
Method Summary
 boolean equals(Object obj)
          
 Comparable<?> getComparable()
           
 Resource getResource(ResourceResolver arg0, javax.servlet.http.HttpServletRequest arg1, String arg2)
          Returns a resource from this resource provider or null if the resource provider cannot find it.
 Resource getResource(ResourceResolver arg0, String arg1)
          Returns a resource from this resource provider or null if the resource provider cannot find it.
 int hashCode()
          
 Iterator<Resource> listChildren(Resource arg0)
          Returns an Iterator of Resource objects loaded from the children of the given Resource.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedResourceProvider

public WrappedResourceProvider(ResourceProvider resourceProvider,
                               Comparable<?> serviceReference)
Method Detail

getResource

public Resource getResource(ResourceResolver arg0,
                            String arg1)
Returns a resource from this resource provider or null if the resource provider cannot find it. The path should have one of the ResourceProvider.ROOTS strings as its prefix.

Specified by:
getResource in interface ResourceProvider
Parameters:
arg0 - The ResourceResolver to which the returned Resource is attached.
Returns:
null If this provider does not have a resource for the path.
See Also:
ResourceProvider.getResource(org.apache.sling.api.resource.ResourceResolver, java.lang.String)

getResource

public Resource getResource(ResourceResolver arg0,
                            javax.servlet.http.HttpServletRequest arg1,
                            String arg2)
Returns a resource from this resource provider or null if the resource provider cannot find it. The path should have one of the ResourceProvider.ROOTS strings as its prefix.

This method is called to resolve a resource for the given request. The properties of the request, such as request parameters, may be use to parametrize the resource resolution. An example of such parametrization is support for a JSR-311 style resource provider to support the parametrized URL patterns.

Specified by:
getResource in interface ResourceProvider
Parameters:
arg0 - The ResourceResolver to which the returned Resource is attached.
Returns:
null If this provider does not have a resource for the path.
See Also:
ResourceProvider.getResource(org.apache.sling.api.resource.ResourceResolver, javax.servlet.http.HttpServletRequest, java.lang.String)

listChildren

public Iterator<Resource> listChildren(Resource arg0)
Returns an Iterator of Resource objects loaded from the children of the given Resource. The returned Resource instances are attached to the same ResourceResolver as the given parent resource.

This method may be called for resource providers whose root path list contains a path such that the resource path is a prefix of the list entry. This allows for the enumeration of deeply nested provided resources for which no actual parent hierarchy exists.

The returned iterator may in turn contain resources which do not actually exist but are required to traverse the resource tree. Such resources SHOULD be SyntheticResource objects whose resource type MUST be set to ResourceProvider.RESOURCE_TYPE_SYNTHETIC.

Specified by:
listChildren in interface ResourceProvider
Parameters:
arg0 - The Resource whose children are requested.
Returns:
An Iterator of Resource objects or null if the resource provider has no children for the given resource.
See Also:
ResourceProvider.listChildren(org.apache.sling.api.resource.Resource)

getComparable

public Comparable<?> getComparable()

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.