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 ItemFilterSetEXCLUDE_ALLThe exclude all item filter setstatic ItemFilterSetINCLUDE_ALLThe include all item filter set
-
Constructor Summary
Constructors Constructor Description ItemFilterSet()Default constructor. initializes the root path to "/"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 booleancontains(Item item, int depth)Evaluates the filters if this set doescoverthe given item. otherwisefalseis returned.booleancontains(Item item, String path, int depth)Evaluates the filters if this set doescoverthe given item. otherwisefalseis returned.-
Methods inherited from class org.apache.jackrabbit.vault.fs.api.FilterSet
addAll, addExclude, addInclude, covers, dump, equals, getDirectChildNameTowardsFilterRoot, 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 doescoverthe given item. otherwisefalseis returned. The result of the evaluation is the polarity of the last matched item. If no filter matches it returnstrueif the first filter is an exclude filter or if no filter is defined;falseif the first filter is an include filter.- Parameters:
item- the item to checkdepth- the depth to check- Returns:
trueif 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 doescoverthe given item. otherwisefalseis returned. The result of the evaluation is the polarity of the last matched item. If no filter matches it returnstrueif the first filter is an exclude filter or if no filter is defined;falseif the first filter is an include filter.- Parameters:
item- the item to checkpath- of the item ornulldepth- the depth to check- Returns:
trueif this set matches the item- Throws:
RepositoryException- if an error occurs.
-
-