Class LocationIterator
- java.lang.Object
-
- org.apache.sling.servlets.resolver.internal.helper.LocationIterator
-
public class LocationIterator extends Object implements Iterator<String>
TheLocationIteratorprovides 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 Summary
Constructors Constructor 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 theresourceand ending with the givenbaseResourceType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Returnstrueif there is another entryStringnext()Returns the next entry of this iterator.voidremove()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
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 theresourceand ending with the givenbaseResourceType.- Parameters:
resourceType- the initial resource type.resourceSuperType- the initial resource super type.baseResourceType- The base resource type.resolver- The resource resolver
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returnstrueif there is another entry
-
next
public String next()
Returns the next entry of this iterator.- Specified by:
nextin interfaceIterator<String>- Throws:
NoSuchElementException- ifhasNext()returnsfalse.
-
remove
public void remove()
- Specified by:
removein interfaceIterator<String>- Throws:
UnsupportedOperationException
-
-