org.apache.jackrabbit.commons.predicate
Class IsNodePredicate

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

public class IsNodePredicate
extends DepthPredicate

Item filter that checks if an item is a node.


Field Summary
protected  boolean isNode
          Polarity of this filter
 
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
IsNodePredicate()
          Default constructor.
IsNodePredicate(boolean polarity)
          Creates a new node item filter
IsNodePredicate(boolean polarity, int minDepth, int maxDepth)
          Creates a new node item filter.
 
Method Summary
protected  boolean matches(Item item)
          Returns true if the item is a node and the polarity is positive (true).
 
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

isNode

protected final boolean isNode
Polarity of this filter

Constructor Detail

IsNodePredicate

public IsNodePredicate()
Default constructor.


IsNodePredicate

public IsNodePredicate(boolean polarity,
                       int minDepth,
                       int maxDepth)
Creates a new node item filter.

Parameters:
polarity - the polarity of this filter. if true it matches nodes, if false it matches properties.
minDepth - the minimum depth
maxDepth - the maximum depth
See Also:
DepthPredicate

IsNodePredicate

public IsNodePredicate(boolean polarity)
Creates a new node item filter

Parameters:
polarity - the polarity of this filter. if true it matches nodes, if false it matches properties.
Method Detail

matches

protected boolean matches(Item item)
                   throws RepositoryException
Returns true if the item is a node and the polarity is positive (true).

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.