public final class CompositePattern extends java.lang.Object implements RestrictionPattern
RestrictionPattern
s into a single pattern.
The implementations of matches
returns true
if all aggregated
patterns successfully validate the given parameters and returns false
as soon as the first aggregated pattern returns false
.EMPTY
Constructor and Description |
---|
CompositePattern(@NotNull java.util.List<RestrictionPattern> patterns) |
Modifier and Type | Method and Description |
---|---|
static RestrictionPattern |
create(@NotNull java.util.List<RestrictionPattern> patterns) |
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. |
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. |
public CompositePattern(@NotNull @NotNull java.util.List<RestrictionPattern> patterns)
public static RestrictionPattern create(@NotNull @NotNull java.util.List<RestrictionPattern> patterns)
public boolean matches(@NotNull @NotNull Tree tree, @Nullable @Nullable PropertyState property)
RestrictionPattern
true
if the underlying restriction matches the specified
tree or property state.matches
in interface RestrictionPattern
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.public boolean matches(@NotNull @NotNull java.lang.String path)
RestrictionPattern
true
if the underlying restriction matches the specified path.
Note, that if the nature of the item at path
is know RestrictionPattern.matches(String, boolean)
should be called
instead.matches
in interface RestrictionPattern
path
- The path of the target item.true
if the underlying restriction matches the specified
path; false
otherwise.public boolean matches(@NotNull @NotNull java.lang.String path, boolean isProperty)
RestrictionPattern
true
if the underlying restriction matches the specified path and item type.
If the nature of the item at path
is unknown RestrictionPattern.matches(String)
should be called instead.
Note, for backwards compatibility this method comes with a default implementation making it equivalent to RestrictionPattern.matches(String)
.
Implementations of the RestrictionPattern
interface should overwrite the default if the underlying
restriction applies different behavior for nodes and properties.matches
in interface RestrictionPattern
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.public boolean matches()
RestrictionPattern
true
if the underlying restriction matches for repository
level permissions.matches
in interface RestrictionPattern
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.