org.apache.jackrabbit.commons.predicate
Class NodeTypePredicate
java.lang.Object
org.apache.jackrabbit.commons.predicate.DepthPredicate
org.apache.jackrabbit.commons.predicate.NodeTypePredicate
- All Implemented Interfaces:
- Predicate
public class NodeTypePredicate
- extends DepthPredicate
Filters on the node type of a node.
Fields inherited from interface org.apache.jackrabbit.commons.predicate.Predicate |
TRUE |
Constructor Summary |
NodeTypePredicate(String nodeType,
boolean respectSupertype)
Creates a new node type filter. |
NodeTypePredicate(String nodeType,
boolean respectSupertype,
int minDepth,
int maxDepth)
Creates a new node type filter. |
Method Summary |
protected boolean |
matches(Item item)
Returns true if the item is a node and if the configured
nodetype is equal to the primary type of the node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nodeType
protected final String nodeType
- the nodetype to filter on
respectSupertype
protected final boolean respectSupertype
- indicates if supertypes should be respected
NodeTypePredicate
public NodeTypePredicate(String nodeType,
boolean respectSupertype,
int minDepth,
int maxDepth)
- Creates a new node type filter.
- Parameters:
nodeType
- the node type to filter onrespectSupertype
- indicates if supertype should be respectedminDepth
- the minimal depthmaxDepth
- the maximal depth
NodeTypePredicate
public NodeTypePredicate(String nodeType,
boolean respectSupertype)
- Creates a new node type filter.
- Parameters:
nodeType
- the node type to filter onrespectSupertype
- indicates if supertype should be respected
matches
protected boolean matches(Item item)
throws RepositoryException
- Returns
true
if the item is a node and if the configured
nodetype is equal to the primary type of the node. if supertypes are
respected it also returns true
if the items nodetype
extends from the configured node type (Node.isNodeType() check).
- 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.