Class NodeIteratorIterable<A extends AmetysObject>

java.lang.Object
org.ametys.plugins.repository.NodeIteratorIterable<A>
Type Parameters:
A - the actual type of AmetysObjects.
All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<A>, AmetysObjectIterable<A>

public class NodeIteratorIterable<A extends AmetysObject> extends Object implements AmetysObjectIterable<A>
Implementation of AmetysObjectIterable based on a underlying JCR NodeIterator.

Please note that this implementation only works with NodeIterators containing nodes actually bound to AmetysObjects.
If a node exists in the iterator and does not correspond to an AmetysObject, an AmetysRepositoryException will be thrown.

Unless AmetysObjectIterator.skip(long) is called on the underlying Iterator, results are buffered so that one may safely call iterator() more than once, even if the underlying NodeIterator will be consumed only once.
If AmetysObjectIterator.skip(long) is called, any subsequent call to iterator() will throw an IllegalStateException.