Class FilteringNodeState
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
- org.apache.jackrabbit.oak.plugins.migration.AbstractDecoratedNodeState
-
- org.apache.jackrabbit.oak.plugins.migration.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:AbstractDecoratedNodeState.exists()
AbstractDecoratedNodeState.hasChildNode(String)
AbstractDecoratedNodeState.getChildNodeEntries()
false
, then the implementation will hide thejcr:uuid
property onnt:frozenNode
nodes (see also OAK-9134).
Additionally, hidden node-state names are removed from the property:childOrder
in the following two methods:
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull NodeState
wrap(@NotNull java.lang.String path, @NotNull NodeState delegate, @Nullable java.util.Set<java.lang.String> includePaths, @Nullable java.util.Set<java.lang.String> excludePaths, @Nullable java.util.Set<java.lang.String> fragmentPaths, @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.-
Methods inherited from class org.apache.jackrabbit.oak.plugins.migration.AbstractDecoratedNodeState
builder, compareAgainstBaseState, equals, exists, getChildNode, getChildNodeEntries, getDelegate, getProperties, getProperty, hasChildNode
-
Methods inherited from class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
checkValidName, compareAgainstBaseState, comparePropertiesAgainstBaseState, equals, getBoolean, getBoolean, getChildNodeCount, getChildNodeNames, getLong, getLong, getName, getName, getNames, getNames, getPropertyCount, getString, getString, getStrings, getStrings, hashCode, hasProperty, isValidName, toString, toString
-
-
-
-
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 ["/"] ifnull
.excludePaths
- A Set of paths that should be hidden. Empty ifnull
.fragmentPaths
- A Set of paths that should support the fragments (see below). Empty ifnull
.excludedFragments
- A Set of name fragments that should be hidden. Empty ifnull
.referenceableFrozenNodes
- Whether nt:frozenNode are referenceable on the target.- Returns:
- The decorated node-state if required, the original node-state if decoration is unnecessary.
-
-