Class ItemFilterSet
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.api.FilterSet<ItemFilter>
-
- org.apache.jackrabbit.vault.fs.api.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.vault.fs.api.FilterSet
FilterSet.Entry<E extends Filter>
-
-
Field Summary
Fields Modifier and Type Field Description static ItemFilterSet
EXCLUDE_ALL
The exclude all item filter setstatic ItemFilterSet
INCLUDE_ALL
The include all item filter set
-
Constructor Summary
Constructors Constructor Description ItemFilterSet()
Default constructor.ItemFilterSet(String root)
Creates a new item filter set and sets the respective root path
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Item item, int depth)
Evaluates the filters if this set doescover
the given item.boolean
contains(Item item, String path, int depth)
Evaluates the filters if this set doescover
the given item.-
Methods inherited from class org.apache.jackrabbit.vault.fs.api.FilterSet
addAll, addExclude, addInclude, covers, dump, equals, getEntries, getImportMode, getRoot, hashCode, isAncestor, isEmpty, isSealed, seal, setImportMode, setRoot, toString
-
-
-
-
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 doescover
the given item. otherwisefalse
is returned. The result of the evaluation is the polarity of the last matched item. If no filter matches it returnstrue
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 checkdepth
- 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 doescover
the given item. otherwisefalse
is returned. The result of the evaluation is the polarity of the last matched item. If no filter matches it returnstrue
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 checkpath
- of the item ornull
depth
- the depth to check- Returns:
true
if this set matches the item- Throws:
RepositoryException
- if an error occurs.
-
-