Package org.xmldb.api.base
Interface ResourceIterator
-
public interface ResourceIteratorResourceIterator is used to iterate over a set of resources.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidforEachRemaining(java.util.function.Consumer<? super Resource> action)Calls the given action for each resource.booleanhasMoreResources()Returns true as long as there are still more resources to be iterated.ResourcenextResource()Returns the nextResourceinstance in the iterator.
-
-
-
Method Detail
-
hasMoreResources
boolean hasMoreResources() throws XMLDBExceptionReturns true as long as there are still more resources to be iterated.- Returns:
- true if there are more resources to iterate, false otherwise.
- Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
nextResource
Resource nextResource() throws XMLDBException
Returns the nextResourceinstance in the iterator.- Returns:
- the next
Resourceinstance in the iterator. - Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.ErrorCodes.NO_SUCH_RESOURCEif the resource iterator is empty or all resources have already been retrieved.
-
forEachRemaining
default void forEachRemaining(java.util.function.Consumer<? super Resource> action) throws XMLDBException
Calls the given action for each resource.- Parameters:
action- the action being called with each resource found- Throws:
XMLDBException- if an error during internal loop occurs
-
-