Class FilteringNodeState

  • All Implemented Interfaces:

    public class FilteringNodeState
    extends AbstractDecoratedNodeState
    NodeState implementation that decorates another node-state instance in order to hide subtrees or partial subtrees from the consumer of the API.
    The set of visible subtrees is defined by two parameters: include paths and exclude paths, both of which are sets of absolute paths.
    Any paths that are equal or are descendants of one of the excluded paths are hidden by this implementation.
    For all included paths, the direct ancestors, the node-state at the path itself and all descendants are visible. Any siblings of the defined path or its ancestors are implicitly hidden (unless made visible by another include path).
    The implementation delegates to the decorated node-state instance and filters out hidden node-states in the following methods: When referenceableFrozenNodes is set to false, then the implementation will hide the jcr:uuid property on nt:frozenNode nodes (see also OAK-9134).
    Additionally, hidden node-state names are removed from the property :childOrder in the following two methods:
    • Method Detail

      • wrap

        public static @NotNull NodeState wrap​(@NotNull
                                              @NotNull String path,
                                              @NotNull NodeState delegate,
                                              @Nullable Set<String> includePaths,
                                              @Nullable Set<String> excludePaths,
                                              @Nullable Set<String> fragmentPaths,
                                              @Nullable Set<String> excludedFragments,
                                              boolean referenceableFrozenNodes)
        Factory method that conditionally decorates the given node-state iff the node-state is (a) hidden itself or (b) has hidden descendants.
        path - The path where the node-state should be assumed to be located.
        delegate - The node-state to decorate.
        includePaths - A Set of paths that should be visible. Defaults to ["/"] if null.
        excludePaths - A Set of paths that should be hidden. Empty if null.
        fragmentPaths - A Set of paths that should support the fragments (see below). Empty if null.
        excludedFragments - A Set of name fragments that should be hidden. Empty if null.
        referenceableFrozenNodes - Whether nt:frozenNode are referenceable on the target.
        The decorated node-state if required, the original node-state if decoration is unnecessary.