public class ResourceCollector extends AbstractResourceCollector
ResourceCollector class provides a single public method -
#getServlets(ResourceResolver) - which is used to find an ordered
collection of Resource instances which may be used to find a
servlet or script to handle a request to the given resource.| Modifier and Type | Field and Description |
|---|---|
protected static int |
WEIGHT_NO_MATCH
The special value returned by
#calculatePrefixMethodWeight(Resource, String, boolean) if the
resource is not suitable to handle the request according to the location
prefix, request selectors and request extension (value is
Integer.MIN_VALUE). |
baseResourceType, executionPaths, extension, hashCode, resourceSuperType, resourceType| Constructor and Description |
|---|
ResourceCollector(String methodName,
String baseResourceType,
org.apache.sling.api.resource.Resource resource,
String[] executionPaths)
Deprecated.
|
ResourceCollector(String methodName,
String baseResourceType,
org.apache.sling.api.resource.Resource resource,
String extension,
String[] executionPaths)
Creates a
ResourceCollector finding servlets and scripts for
the given methodName. |
| Modifier and Type | Method and Description |
|---|---|
static ResourceCollector |
create(org.apache.sling.api.resource.Resource resource,
String extension,
String[] executionPaths,
String[] defaultExtensions,
String methodName,
String[] selectors) |
static ResourceCollector |
create(org.apache.sling.api.SlingHttpServletRequest request,
String[] executionPaths,
String[] defaultExtensions)
Creates a
ResourceCollector for the given
request. |
boolean |
equals(Object obj) |
protected void |
getWeightedResources(Set<org.apache.sling.servlets.resolver.internal.helper.WeightedResource> resources,
org.apache.sling.api.resource.Resource location) |
addWeightedResource, getResource, getServlets, hashCode, stringEqualsprotected static final int WEIGHT_NO_MATCH
#calculatePrefixMethodWeight(Resource, String, boolean) if the
resource is not suitable to handle the request according to the location
prefix, request selectors and request extension (value is
Integer.MIN_VALUE).@Deprecated public ResourceCollector(String methodName, String baseResourceType, org.apache.sling.api.resource.Resource resource, String[] executionPaths)
ResourceCollector(String, String, Resource, String, String[]) instead.ResourceCollector finding servlets and scripts for
the given methodName.methodName - The methodName used to find scripts for.
This must not be null.baseResourceType - The basic resource type to use as a final
resource super type. If this is null the default
value
org.apache.sling.servlets.resolver.internal.ServletResolverConstants#DEFAULT_SERVLET_NAME
is assumed.resource - the resource to invoke, the resource type and resource
super type are taken from this resource.executionPaths - the execution paths to considerpublic ResourceCollector(String methodName, String baseResourceType, org.apache.sling.api.resource.Resource resource, String extension, String[] executionPaths)
ResourceCollector finding servlets and scripts for
the given methodName.methodName - The methodName used to find scripts for.
This must not be null.baseResourceType - The basic resource type to use as a final
resource super type. If this is null the default
value
org.apache.sling.servlets.resolver.internal.ServletResolverConstants#DEFAULT_SERVLET_NAME
is assumed.resource - the resource to invoke, the resource type and resource
super type are taken from this resource.extension - the extension of the request being processedexecutionPaths - the execution paths to considerpublic static ResourceCollector create(org.apache.sling.api.SlingHttpServletRequest request, String[] executionPaths, String[] defaultExtensions)
ResourceCollector for the given
request. If the request is a GET or HEAD request, a
specialized instance is returned which also takes the request selectors
and request extension into account for finding servlet resources.
Otherwise an instance of this class itself is returned which just takes
the resource type and request method name into account.request - The SlingHttpServletRequest for which to
return a ResourceCollector.ResourceCollector to find servlets and scripts
suitable for handling the request.public static ResourceCollector create(org.apache.sling.api.resource.Resource resource, String extension, String[] executionPaths, String[] defaultExtensions, String methodName, String[] selectors)
protected void getWeightedResources(Set<org.apache.sling.servlets.resolver.internal.helper.WeightedResource> resources, org.apache.sling.api.resource.Resource location)
getWeightedResources in class AbstractResourceCollectorpublic boolean equals(Object obj)
equals in class AbstractResourceCollectorCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.