public class LocationIterator extends Object implements Iterator<String>
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:
/apps/sample/libs/sample/apps/super/libs/super/apps/default/libs/default| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns
true if there is another entry |
String |
next()
Returns the next entry of this iterator.
|
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic LocationIterator(String resourceType, String resourceSuperType, String baseResourceType, org.apache.sling.api.resource.ResourceResolver resolver)
resource and ending with the
given baseResourceType.resourceType - the initial resource type.resourceSuperType - the initial resource super type.baseResourceType - The base resource type.resolver - The resource resolverpublic boolean hasNext()
true if there is another entrypublic String next()
next in interface Iterator<String>NoSuchElementException - if hasNext() returns
false.public void remove()
remove in interface Iterator<String>UnsupportedOperationExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.