Class FilteringNodeState

  • All Implemented Interfaces:
    NodeState

    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:
    • Field Detail

      • ALL

        public static final java.util.Set<java.lang.String> ALL
      • NONE

        public static final java.util.Set<java.lang.String> NONE
    • Method Detail

      • wrap

        @NotNull
        public static @NotNull NodeState wrap​(@NotNull
                                              @NotNull java.lang.String path,
                                              @NotNull
                                              @NotNull NodeState delegate,
                                              @Nullable
                                              @Nullable java.util.Set<java.lang.String> includePaths,
                                              @Nullable
                                              @Nullable java.util.Set<java.lang.String> excludePaths,
                                              @Nullable
                                              @Nullable java.util.Set<java.lang.String> fragmentPaths,
                                              @Nullable
                                              @Nullable java.util.Set<java.lang.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.
        Parameters:
        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.
        Returns:
        The decorated node-state if required, the original node-state if decoration is unnecessary.