org.apache.jackrabbit.commons.predicate
Class NamePredicate

java.lang.Object
  extended by org.apache.jackrabbit.commons.predicate.DepthPredicate
      extended by org.apache.jackrabbit.commons.predicate.NamePredicate
All Implemented Interfaces:
Predicate

public class NamePredicate
extends DepthPredicate

Filters items according to their names.


Field Summary
protected  String name
          The name to filter on
 
Fields inherited from class org.apache.jackrabbit.commons.predicate.DepthPredicate
maxDepth, minDepth
 
Fields inherited from interface org.apache.jackrabbit.commons.predicate.Predicate
FALSE, TRUE
 
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 org.apache.jackrabbit.commons.predicate.DepthPredicate
evaluate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 on
minDepth - the minimal depth
maxDepth - 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
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-2010 The Apache Software Foundation. All Rights Reserved.