Class LocationIterator

  • All Implemented Interfaces:
    Iterator<String>

    public class LocationIterator
    extends Object
    implements Iterator<String>
    The LocationIterator provides access to an ordered collection of absolute paths containing potential request handling. The primary order of the collection is the resource type hierarchy with the base resource type at the top. The secondary order is the search path retrieved from the resource resolver.

    Example: For a node type hierarchy "sample" > "super" > "default" and a search path of [ "/apps", "/libs" ], the iterator would provide access to the following list of paths:

    1. /apps/sample
    2. /libs/sample
    3. /apps/super
    4. /libs/super
    5. /apps/default
    6. /libs/default
    • Constructor Detail

      • LocationIterator

        public LocationIterator​(String resourceType,
                                String resourceSuperType,
                                String baseResourceType,
                                org.apache.sling.api.resource.ResourceResolver resolver)
        Creates an instance of this iterator starting with a location built from the resource type of the resource and ending with the given baseResourceType.
        Parameters:
        resourceType - the initial resource type.
        resourceSuperType - the initial resource super type.
        baseResourceType - The base resource type.
        resolver - The resource resolver