org.apache.jackrabbit.commons.predicate
Class DeclaringTypePredicate

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

public class DeclaringTypePredicate
extends DepthPredicate

Filter that checks the declared type of an item


Field Summary
protected  String nodeType
          The nodetype to check
protected  boolean propsOnly
          indicates if only props should be checked
 
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
DeclaringTypePredicate(String nodeType, boolean propsOnly)
          Creates a new filter for the given nodetype and flags
DeclaringTypePredicate(String nodeType, boolean propsOnly, int minDepth, int maxDepth)
          Creates a new filter for the given nodetype and flags.
 
Method Summary
protected  boolean matches(Item item)
          Matches if the declaring nodetype of the item is equal to the one specified in this filter.
 
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

nodeType

protected final String nodeType
The nodetype to check


propsOnly

protected final boolean propsOnly
indicates if only props should be checked

Constructor Detail

DeclaringTypePredicate

public DeclaringTypePredicate(String nodeType,
                              boolean propsOnly,
                              int minDepth,
                              int maxDepth)
Creates a new filter for the given nodetype and flags.

Parameters:
nodeType - the nodetype name to check
propsOnly - if true only properties are checked
minDepth - the minimal depth
maxDepth - the maximal depth

DeclaringTypePredicate

public DeclaringTypePredicate(String nodeType,
                              boolean propsOnly)
Creates a new filter for the given nodetype and flags

Parameters:
nodeType - the nodetype name to check
propsOnly - if true only properties are checked
Method Detail

matches

protected boolean matches(Item item)
                   throws RepositoryException
Matches if the declaring nodetype of the item is equal to the one specified in this filter. If the item is a node and propsOnly flag is true it returns false.

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.