org.apache.jackrabbit.commons.predicate
Class NamePredicate
java.lang.Object
org.apache.jackrabbit.commons.predicate.DepthPredicate
org.apache.jackrabbit.commons.predicate.NamePredicate
- All Implemented Interfaces:
- org.apache.commons.collections.Predicate
public class NamePredicate
- extends DepthPredicate
Filters items according to their names.
Field Summary |
protected String |
name
The name to filter on |
Constructor Summary |
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 |
protected boolean |
matches(Item item)
Returns true if the name of the given item is equal to
the configured name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected final String name
- The name to filter on
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
matches
protected boolean matches(Item item)
throws RepositoryException
- Returns
true
if the name of the given item is equal to
the configured name.
- Overrides:
matches
in class DepthPredicate
- 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)
Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.