Class FilterSet<E extends Filter>
java.lang.Object
org.apache.jackrabbit.vault.fs.api.FilterSet<E>
- All Implemented Interfaces:
Dumpable
- Direct Known Subclasses:
ItemFilterSet,PathFilterSet
The item filter set holds a set of item filters each attributed 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 ClassesModifier and TypeClassDescriptionstatic classFilterSet.Entry<E extends Filter>Holds a filter entry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds (replaces) all entries from the given set to this one.addExclude(E filter) Adds a new item filter as excluded entry.addInclude(E filter) Adds a new item filter as included entry.booleanChecks if the given item is covered by this filter set.voiddump(@NotNull DumpContext ctx, boolean isLast) Dumps some human readable information using the given context.boolean@NotNull List<FilterSet.Entry<E>> Returns the list of entries@NotNull ImportModeReturns the import mode that is specified for this filter set.@NotNull StringgetRoot()Returns the root pathinthashCode()booleanisAncestor(@NotNull String path) Checks if the given item is an ancestor of the root node.booleanisEmpty()Checks if this filter set has any entries defined.booleanisSealed()Checks if this filter set is sealed.seal()Seals this list, i.e.voidsetImportMode(@NotNull ImportMode mode) Sets the import mode.voidSets the root pathtoString()
-
Constructor Details
-
FilterSet
public FilterSet()Default constructor. initializes the root path to "/" -
FilterSet
Creates a new item filter set and sets the respective root path- Parameters:
root- path
-
-
Method Details
-
getRoot
Returns the root path- Returns:
- root path
-
setRoot
Sets the root path- Parameters:
path- root path
-
getImportMode
Returns the import mode that is specified for this filter set. Defaults toImportMode.REPLACE.- Returns:
- the import mode.
-
setImportMode
Sets the import mode.- Parameters:
mode- import mode
-
seal
Seals this list, i.e. makes it unmodifiable.- Returns:
- this list
-
isSealed
public boolean isSealed()Checks if this filter set is sealed.- Returns:
trueif sealed.
-
addAll
Adds (replaces) all entries from the given set to this one.- Parameters:
set- the set of entries- Returns:
thissuitable for chaining.
-
addInclude
Adds a new item filter as included entry.- Parameters:
filter- the filter- Returns:
thissuitable for chaining.
-
addExclude
Adds a new item filter as excluded entry.- Parameters:
filter- the filter- Returns:
thissuitable for chaining.
-
getEntries
Returns the list of entries- Returns:
- the list of entries
-
isEmpty
public boolean isEmpty()Checks if this filter set has any entries defined.- Returns:
trueif empty
-
covers
Checks if the given item is covered by this filter set. I.e. if the node addressed by therootpath is an ancestor of the given item.- Parameters:
path- path of the item- Returns:
trueif this set covers the given item
-
isAncestor
Checks if the given item is an ancestor of the root node.- Parameters:
path- path of the item to check- Returns:
trueif the given item is an ancestor
-
dump
Dumps some human readable information using the given context. -
hashCode
public int hashCode() -
equals
-
toString
-