Class ItemFilterSet

  • All Implemented Interfaces:
    Dumpable

    public class ItemFilterSet
    extends FilterSet<ItemFilter>
    The item filter set holds a set of item filters each attributes as include or exclude filter. The evaluation of the set allows included items and rejects excluded items.

    Additionally it contains a "root" path for which the filters are evaluated. if an item has not the node addressed by the root path as ancestor, it is always excluded.

    • Field Detail

      • INCLUDE_ALL

        public static final ItemFilterSet INCLUDE_ALL
        The include all item filter set
      • EXCLUDE_ALL

        public static final ItemFilterSet EXCLUDE_ALL
        The exclude all item filter set
    • Constructor Detail

      • ItemFilterSet

        public ItemFilterSet()
        Default constructor. initializes the root path to "/"
      • ItemFilterSet

        public ItemFilterSet​(String root)
        Creates a new item filter set and sets the respective root path
        Parameters:
        root - path
    • Method Detail

      • contains

        public boolean contains​(Item item,
                                int depth)
                         throws RepositoryException
        Evaluates the filters if this set does cover the given item. otherwise false is returned. The result of the evaluation is the polarity of the last matched item. If no filter matches it returns true if the first filter is an exclude filter or if no filter is defined; false if the first filter is an include filter.
        Parameters:
        item - the item to check
        depth - the depth to check
        Returns:
        true if this set matches the item
        Throws:
        RepositoryException - if an error occurs.
      • contains

        public boolean contains​(Item item,
                                String path,
                                int depth)
                         throws RepositoryException
        Evaluates the filters if this set does cover the given item. otherwise false is returned. The result of the evaluation is the polarity of the last matched item. If no filter matches it returns true if the first filter is an exclude filter or if no filter is defined; false if the first filter is an include filter.
        Parameters:
        item - the item to check
        path - of the item or null
        depth - the depth to check
        Returns:
        true if this set matches the item
        Throws:
        RepositoryException - if an error occurs.