Class PathFilterSet
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.api.FilterSet<PathFilter>
-
- org.apache.jackrabbit.vault.fs.api.PathFilterSet
-
- All Implemented Interfaces:
Dumpable
public class PathFilterSet extends FilterSet<PathFilter>
The path filter set holds a set of path filters each attributes as include or exclude filter. The evaluation of the set allows included paths and rejects excluded paths.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 PathFilterSet
EXCLUDE_ALL
The exclude all item filter setstatic PathFilterSet
INCLUDE_ALL
The include all item filter set
-
Constructor Summary
Constructors Constructor Description PathFilterSet()
Default constructor.PathFilterSet(java.lang.String root)
Creates a new path filter set and sets the respective root path
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.String path)
Evaluates the filters if this set doescover
the given item.java.lang.String
getType()
Returns the filter type ornull
boolean
hasOnlyRelativePatterns()
Checks if this path filter set only contains entries that are relative include patterns, eg: ".* /foo.*".FilterSet
seal()
Seals this list, i.e.PathFilterSet
setType(java.lang.String type)
Sets the filter typePathFilterSet
translate(PathMapping mapping)
Translates this path filter with the given mapping.-
Methods inherited from class org.apache.jackrabbit.vault.fs.api.FilterSet
addAll, addExclude, addInclude, covers, dump, equals, getEntries, getImportMode, getRoot, hashCode, isAncestor, isEmpty, isSealed, setImportMode, setRoot, toString
-
-
-
-
Field Detail
-
INCLUDE_ALL
public static final PathFilterSet INCLUDE_ALL
The include all item filter set
-
EXCLUDE_ALL
public static final PathFilterSet EXCLUDE_ALL
The exclude all item filter set
-
-
Method Detail
-
contains
public boolean contains(@Nonnull java.lang.String path)
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 path. 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:
path
- the path to check- Returns:
true
if this set matches the item
-
seal
@Nonnull public FilterSet seal()
Description copied from class:FilterSet
Seals this list, i.e. makes it unmodifiable.- Overrides:
seal
in classFilterSet<PathFilter>
- Returns:
- this list
-
translate
@Nonnull public PathFilterSet translate(@Nullable PathMapping mapping)
Translates this path filter with the given mapping. Note that only absolute filters can be translated.- Parameters:
mapping
- the mapping to apply- Returns:
- the new filter
- Since:
- 2.4.10
-
hasOnlyRelativePatterns
public boolean hasOnlyRelativePatterns()
Checks if this path filter set only contains entries that are relative include patterns, eg: ".* /foo.*". in this case the aggregator will use a different strategy when providing non matching leave nodes.- Returns:
true
if only contains relative patterns
-
getType
@Nullable public java.lang.String getType()
Returns the filter type ornull
- Returns:
- the filter type.
-
setType
@Nonnull public PathFilterSet setType(@Nullable java.lang.String type)
Sets the filter type- Parameters:
type
- the type- Returns:
- this.
-
-