Class ItemSequence
- java.lang.Object
-
- org.apache.jackrabbit.commons.flat.ItemSequence
-
public abstract class ItemSequence extends java.lang.Object
This class serves as main entry point for obtaining sequences of
Node
s andProperty
s. It provides factory methods for creatingNodeSequence
s andPropertySequence
s.NodeSequence and PropertySequence instances provide a flat representation of a JCR hierarchy rooted at a certain node. They allow iterating over all items, retrieving items by key, checking whether a given key is mapped, adding new items and removing existing items.
The specifics of the mapping from the flat representation to the JCR hierarchy are delegated to a
TreeManager
. Particularly the TreeManager specifies the order of the items when retrieved as sequence and when and how to add and remove intermediate nodes when new items are inserted or removed.An
TreeTraverser.ErrorHandler
is used to handle exceptions which occur while traversing the hierarchy.- See Also:
TreeTraverser
,NodeSequence
,PropertySequence
,TreeManager
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeSequence
createNodeSequence(TreeManager treeManager)
Create a newNodeSequence
instance.static NodeSequence
createNodeSequence(TreeManager treeManager, TreeTraverser.ErrorHandler errorHandler)
Create a newNodeSequence
instance.static PropertySequence
createPropertySequence(TreeManager treeManager)
Create a newPropertySequence
instance.static PropertySequence
createPropertySequence(TreeManager treeManager, TreeTraverser.ErrorHandler errorHandler)
Create a newPropertySequence
instance.NodeSequence
getNodeSequence()
Create a newNodeSequence
instance with the same parameterization as this instance.PropertySequence
getPropertySequence()
Create a newPropertySequence
instance with the same parametrization as this instance.
-
-
-
Method Detail
-
createNodeSequence
public static NodeSequence createNodeSequence(TreeManager treeManager, TreeTraverser.ErrorHandler errorHandler)
Create a newNodeSequence
instance.- Parameters:
treeManager
- TheTreeManager
for managing the mapping between the sequence view and the JCR hierarchy.errorHandler
- TheTreeTraverser.ErrorHandler
for handling exceptions occurring while- Returns:
-
createNodeSequence
public static NodeSequence createNodeSequence(TreeManager treeManager)
Create a newNodeSequence
instance.- Parameters:
treeManager
- TheTreeManager
for managing the mapping between the sequence view and the JCR hierarchy.- Returns:
-
createPropertySequence
public static PropertySequence createPropertySequence(TreeManager treeManager, TreeTraverser.ErrorHandler errorHandler)
Create a newPropertySequence
instance.- Parameters:
treeManager
- TheTreeManager
for managing the mapping between the sequence view and the JCR hierarchy.errorHandler
- TheTreeTraverser.ErrorHandler
for handling exceptions occurring while- Returns:
-
createPropertySequence
public static PropertySequence createPropertySequence(TreeManager treeManager)
Create a newPropertySequence
instance.- Parameters:
treeManager
- TheTreeManager
for managing the mapping between the sequence view and the JCR hierarchy.- Returns:
-
getNodeSequence
public NodeSequence getNodeSequence()
Create a newNodeSequence
instance with the same parameterization as this instance.- Returns:
-
getPropertySequence
public PropertySequence getPropertySequence()
Create a newPropertySequence
instance with the same parametrization as this instance.- Returns:
-
-