Class ChildrenCollectorFilter

  • All Implemented Interfaces:
    javax.jcr.ItemVisitor

    public class ChildrenCollectorFilter
    extends javax.jcr.util.TraversingItemVisitor.Default
    ChildrenCollectorFilter is a utility class which can be used to 'collect' child items of a node whose names match a certain pattern. It implements the ItemVisitor interface.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.jcr.util.TraversingItemVisitor

        javax.jcr.util.TraversingItemVisitor.Default
    • Constructor Summary

      Constructors 
      Constructor Description
      ChildrenCollectorFilter​(java.lang.String[] nameGlobs, java.util.Collection<javax.jcr.Item> children, boolean collectNodes, boolean collectProperties, int maxLevel)
      Constructs a ChildrenCollectorFilter
      ChildrenCollectorFilter​(java.lang.String namePattern, java.util.Collection<javax.jcr.Item> children, boolean collectNodes, boolean collectProperties, int maxLevel)
      Constructs a ChildrenCollectorFilter
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.jcr.NodeIterator collectChildNodes​(javax.jcr.Node node, java.lang.String namePattern)  
      static javax.jcr.NodeIterator collectChildNodes​(javax.jcr.Node node, java.lang.String[] nameGlobs)  
      static javax.jcr.PropertyIterator collectProperties​(javax.jcr.Node node, java.lang.String namePattern)  
      static javax.jcr.PropertyIterator collectProperties​(javax.jcr.Node node, java.lang.String[] nameGlobs)  
      static boolean matches​(java.lang.String name, java.lang.String pattern)
      static boolean matches​(java.lang.String name, java.lang.String[] nameGlobs)
      • Methods inherited from class javax.jcr.util.TraversingItemVisitor

        visit, visit
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChildrenCollectorFilter

        public ChildrenCollectorFilter​(java.lang.String namePattern,
                                       java.util.Collection<javax.jcr.Item> children,
                                       boolean collectNodes,
                                       boolean collectProperties,
                                       int maxLevel)
        Constructs a ChildrenCollectorFilter
        Parameters:
        namePattern - the pattern which should be applied to the names of the children
        children - where the matching children should be added
        collectNodes - true, if child nodes should be collected; otherwise false
        collectProperties - true, if child properties should be collected; otherwise false
        maxLevel - number of hierarchy levels to traverse (e.g. 1 for direct children only, 2 for children and their children, and so on)
      • ChildrenCollectorFilter

        public ChildrenCollectorFilter​(java.lang.String[] nameGlobs,
                                       java.util.Collection<javax.jcr.Item> children,
                                       boolean collectNodes,
                                       boolean collectProperties,
                                       int maxLevel)
        Constructs a ChildrenCollectorFilter
        Parameters:
        nameGlobs - an array of globbing strings which should be applied to the names of the children
        children - where the matching children should be added
        collectNodes - true, if child nodes should be collected; otherwise false
        collectProperties - true, if child properties should be collected; otherwise false
        maxLevel - number of hierarchy levels to traverse (e.g. 1 for direct children only, 2 for children and their children, and so on)
    • Method Detail

      • collectChildNodes

        public static javax.jcr.NodeIterator collectChildNodes​(javax.jcr.Node node,
                                                               java.lang.String namePattern)
                                                        throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • collectChildNodes

        public static javax.jcr.NodeIterator collectChildNodes​(javax.jcr.Node node,
                                                               java.lang.String[] nameGlobs)
                                                        throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • collectProperties

        public static javax.jcr.PropertyIterator collectProperties​(javax.jcr.Node node,
                                                                   java.lang.String namePattern)
                                                            throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • collectProperties

        public static javax.jcr.PropertyIterator collectProperties​(javax.jcr.Node node,
                                                                   java.lang.String[] nameGlobs)
                                                            throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException