Interface RestrictionPattern
-
- All Known Implementing Classes:
CompositePattern
public interface RestrictionPattern
Interface used to verify if a givenrestriction
applies to a given item or path.
-
-
Field Summary
Fields Modifier and Type Field Description static RestrictionPattern
EMPTY
Default implementation of theRestrictionPattern
that always returnstrue
and thus matches all items or paths.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
matches()
Returnstrue
if the underlying restriction matches for repository level permissions.boolean
matches(@NotNull java.lang.String path)
Returnstrue
if the underlying restriction matches the specified path.default boolean
matches(@NotNull java.lang.String path, boolean isProperty)
Returnstrue
if the underlying restriction matches the specified path and item type.boolean
matches(@NotNull Tree tree, @Nullable PropertyState property)
Returnstrue
if the underlying restriction matches the specified tree or property state.
-
-
-
Field Detail
-
EMPTY
static final RestrictionPattern EMPTY
Default implementation of theRestrictionPattern
that always returnstrue
and thus matches all items or paths.
-
-
Method Detail
-
matches
boolean matches(@NotNull @NotNull Tree tree, @Nullable @Nullable PropertyState property)
Returnstrue
if the underlying restriction matches the specified tree or property state.- Parameters:
tree
- The target tree or the parent of the target property.property
- The target property state ornull
if the target item is a tree.- Returns:
true
if the underlying restriction matches the specified tree or property state;false
otherwise.
-
matches
boolean matches(@NotNull @NotNull java.lang.String path)
Returnstrue
if the underlying restriction matches the specified path. Note, that if the nature of the item atpath
is knowmatches(String, boolean)
should be called instead.- Parameters:
path
- The path of the target item.- Returns:
true
if the underlying restriction matches the specified path;false
otherwise.
-
matches
default boolean matches(@NotNull @NotNull java.lang.String path, boolean isProperty)
Returnstrue
if the underlying restriction matches the specified path and item type. If the nature of the item atpath
is unknownmatches(String)
should be called instead. Note, for backwards compatibility this method comes with a default implementation making it equivalent tomatches(String)
. Implementations of theRestrictionPattern
interface should overwrite the default if the underlying restriction applies different behavior for nodes and properties.- Parameters:
path
- The path of the target item.isProperty
- Iftrue
the target item is known to be a property, otherwise it is known to be a node.- Returns:
true
if the underlying restriction matches the specified path and item type;false
otherwise.- Since:
- OAK 1.42.0
-
matches
boolean matches()
Returnstrue
if the underlying restriction matches for repository level permissions.- Returns:
true
if the underlying restriction matches for repository level permissions that are not associated with a path or a dedicated item;false
otherwise.
-
-