Interface Sequence<T extends javax.jcr.Item>

  • Type Parameters:
    T - extends <Item>
    All Superinterfaces:
    java.lang.Iterable<T>
    All Known Subinterfaces:
    NodeSequence, PropertySequence

    public interface Sequence<T extends javax.jcr.Item>
    extends java.lang.Iterable<T>
    Interface for accessing JCR Items sequentially through an Iterator or looking them up through a key.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T getItem​(java.lang.String key)
      Retrieve an Item from this sequence by its key.
      boolean hasItem​(java.lang.String key)
      Determine whether this sequence contains a specific key.
      java.util.Iterator<T> iterator()
      Iterator for the Items in this sequence.
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • iterator

        java.util.Iterator<T> iterator()
        Iterator for the Items in this sequence. The order of the items is implementation specific.
        Specified by:
        iterator in interface java.lang.Iterable<T extends javax.jcr.Item>
        See Also:
        Iterable.iterator()
      • getItem

        T getItem​(java.lang.String key)
           throws javax.jcr.AccessDeniedException,
                  javax.jcr.PathNotFoundException,
                  javax.jcr.ItemNotFoundException,
                  javax.jcr.RepositoryException
        Retrieve an Item from this sequence by its key. If the sequence does not contain the key this method throws an ItemNotFoundException.
        Parameters:
        key - The key of the item to retrieve. Must not be null.
        Returns:
        The item belonging to key.
        Throws:
        javax.jcr.ItemNotFoundException
        javax.jcr.RepositoryException
        javax.jcr.AccessDeniedException
        javax.jcr.PathNotFoundException
      • hasItem

        boolean hasItem​(java.lang.String key)
                 throws javax.jcr.RepositoryException
        Determine whether this sequence contains a specific key.
        Parameters:
        key - The key to look up.
        Returns:
        true if this sequence contains key. False otherwise.
        Throws:
        javax.jcr.RepositoryException