Class PathFilter

  • public class PathFilter
    extends Object
    Filter which determines whether given path should be included for processing or not
    • Field Detail


        public static final String PROP_INCLUDED_PATHS
        Multi value property name used to determine list of paths to be included
        See Also:
        Constant Field Values

        public static final 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​(Iterable<String> includes,
                          Iterable<String> excludes)
        Constructs the predicate with given included and excluded paths If both are empty then all paths would be considered to be included
        includes - list of paths which should not be included
        excludes - 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 names PROP_INCLUDED_PATHS and PROP_EXCLUDED_PATHS. Both the properties are optional.
        defn - nodestate representing the configuration. Generally it would be the nodestate representing the index definition
        predicate based on the passed definition state
      • filter

        public PathFilter.Result filter​(@NotNull
                                        @NotNull String path)
        Determines whether given path is to be included or not
        path - path to check
        result indicating if the path needs to be included, excluded or just traversed
      • areAllDescendantsIncluded

        public boolean areAllDescendantsIncluded​(String path)
        Check whether this node and all descendants are included in this filter.
        path - the path
        true if this and all descendants of this path are included in the filter