public interface RestrictionPattern
restriction
applies to a given
item or path.Modifier and Type | Field and Description |
---|---|
static RestrictionPattern |
EMPTY
Default implementation of the
RestrictionPattern that always
returns true and thus matches all items or paths. |
Modifier and Type | Method and Description |
---|---|
boolean |
matches()
Returns
true if the underlying restriction matches for repository
level permissions. |
boolean |
matches(@NotNull java.lang.String path)
Returns
true if the underlying restriction matches the specified path. |
default boolean |
matches(@NotNull java.lang.String path,
boolean isProperty)
Returns
true if the underlying restriction matches the specified path and item type. |
boolean |
matches(@NotNull Tree tree,
@Nullable PropertyState property)
Returns
true if the underlying restriction matches the specified
tree or property state. |
static final RestrictionPattern EMPTY
RestrictionPattern
that always
returns true
and thus matches all items or paths.boolean matches(@NotNull @NotNull Tree tree, @Nullable @Nullable PropertyState property)
true
if the underlying restriction matches the specified
tree or property state.tree
- The target tree or the parent of the target property.property
- The target property state or null
if the target
item is a tree.true
if the underlying restriction matches the specified
tree or property state; false
otherwise.boolean matches(@NotNull @NotNull java.lang.String path)
true
if the underlying restriction matches the specified path.
Note, that if the nature of the item at path
is know matches(String, boolean)
should be called
instead.path
- The path of the target item.true
if the underlying restriction matches the specified
path; false
otherwise.default boolean matches(@NotNull @NotNull java.lang.String path, boolean isProperty)
true
if the underlying restriction matches the specified path and item type.
If the nature of the item at path
is unknown matches(String)
should be called instead.
Note, for backwards compatibility this method comes with a default implementation making it equivalent to matches(String)
.
Implementations of the RestrictionPattern
interface should overwrite the default if the underlying
restriction applies different behavior for nodes and properties.path
- The path of the target item.isProperty
- If true
the target item is known to be a property, otherwise it is known to be a node.true
if the underlying restriction matches the specified path and item type; false
otherwise.boolean matches()
true
if the underlying restriction matches for repository
level permissions.true
if the underlying restriction matches for repository
level permissions that are not associated with a path or a dedicated item;
false
otherwise.Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.