Class PathFilter
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.filter.PathFilter
-
public class PathFilter extends java.lang.ObjectFilter which determines whether given path should be included for processing or not
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPathFilter.Result
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_EXCLUDED_PATHSMulti value property name used to determine list of paths to be excludedstatic java.lang.StringPROP_INCLUDED_PATHSMulti value property name used to determine list of paths to be included
-
Constructor Summary
Constructors Constructor Description PathFilter(java.lang.Iterable<java.lang.String> includes, java.lang.Iterable<java.lang.String> excludes)Constructs the predicate with given included and excluded paths If both are empty then all paths would be considered to be included
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareAllDescendantsIncluded(java.lang.String path)Check whether this node and all descendants are included in this filter.PathFilter.Resultfilter(@NotNull java.lang.String path)Determines whether given path is to be included or notstatic PathFilterfrom(@NotNull NodeBuilder defn)Constructs the predicate based on given definition state.java.lang.StringtoString()
-
-
-
Field Detail
-
PROP_INCLUDED_PATHS
public static final java.lang.String PROP_INCLUDED_PATHS
Multi value property name used to determine list of paths to be included- See Also:
- Constant Field Values
-
PROP_EXCLUDED_PATHS
public static final java.lang.String PROP_EXCLUDED_PATHS
Multi value property name used to determine list of paths to be excluded- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PathFilter
public PathFilter(java.lang.Iterable<java.lang.String> includes, java.lang.Iterable<java.lang.String> excludes)Constructs the predicate with given included and excluded paths If both are empty then all paths would be considered to be included- Parameters:
includes- list of paths which should not be includedexcludes- list of p aths which should be included
-
-
Method Detail
-
from
public static PathFilter from(@NotNull @NotNull NodeBuilder defn)
Constructs the predicate based on given definition state. It looks for multi value property with namesPROP_INCLUDED_PATHSandPROP_EXCLUDED_PATHS. Both the properties are optional.- Parameters:
defn- nodestate representing the configuration. Generally it would be the nodestate representing the index definition- Returns:
- predicate based on the passed definition state
-
filter
public PathFilter.Result filter(@NotNull @NotNull java.lang.String path)
Determines whether given path is to be included or not- Parameters:
path- path to check- Returns:
- result indicating if the path needs to be included, excluded or just traversed
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
areAllDescendantsIncluded
public boolean areAllDescendantsIncluded(java.lang.String path)
Check whether this node and all descendants are included in this filter.- Parameters:
path- the path- Returns:
- true if this and all descendants of this path are included in the filter
-
-