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.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringnodeTypethe nodetype to filter onprotected booleanrespectSupertypeindicates if supertypes should be respected-
Fields inherited from class org.apache.jackrabbit.commons.predicate.DepthPredicate
maxDepth, minDepth
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanmatches(Item item)Returnstrueif the item is a node and if the configured nodetype is equal to the primary type of the node.-
Methods inherited from class org.apache.jackrabbit.commons.predicate.DepthPredicate
evaluate
-
-
-
-
Field Detail
-
nodeType
protected final String nodeType
the nodetype to filter on
-
respectSupertype
protected final boolean respectSupertype
indicates if supertypes should be respected
-
-
Constructor Detail
-
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
-
-
Method Detail
-
matches
protected boolean matches(Item item) throws RepositoryException
Returnstrueif 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 returnstrueif the items nodetype extends from the configured node type (Node.isNodeType() check).- Overrides:
matchesin classDepthPredicate- Parameters:
item- the item to match- Returns:
trueif the item matches;falseotherwise.- Throws:
RepositoryException- if an error occurs.- See Also:
DepthPredicate.matches(javax.jcr.Item)
-
-