Class NamePredicate
- java.lang.Object
-
- org.apache.jackrabbit.commons.predicate.DepthPredicate
-
- org.apache.jackrabbit.commons.predicate.NamePredicate
-
- All Implemented Interfaces:
Predicate
public class NamePredicate extends DepthPredicate
Filters items according to their names.
-
-
Constructor Summary
Constructors Constructor Description NamePredicate(String name)
Creates a new name filter with the given name.NamePredicate(String name, int minDepth, int maxDepth)
Creates a new name filter with the given name and depths
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
matches(Item item)
Returnstrue
if the name of the given item is equal to the configured name.-
Methods inherited from class org.apache.jackrabbit.commons.predicate.DepthPredicate
evaluate
-
-
-
-
Field Detail
-
name
protected final String name
The name to filter on
-
-
Constructor Detail
-
NamePredicate
public NamePredicate(String name, int minDepth, int maxDepth)
Creates a new name filter with the given name and depths- Parameters:
name
- the name to filter onminDepth
- the minimal depthmaxDepth
- the maximal depth
-
NamePredicate
public NamePredicate(String name)
Creates a new name filter with the given name.- Parameters:
name
- the name to filter on
-
-
Method Detail
-
matches
protected boolean matches(Item item) throws RepositoryException
Returnstrue
if the name of the given item is equal to the configured name.- Overrides:
matches
in classDepthPredicate
- Parameters:
item
- the item to match- Returns:
true
if the item matches;false
otherwise.- Throws:
RepositoryException
- if an error occurs.- See Also:
DepthPredicate.matches(javax.jcr.Item)
-
-