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 String
nodeType
the nodetype to filter onprotected boolean
respectSupertype
indicates 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 boolean
matches(Item item)
Returnstrue
if 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
Returnstrue
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 returnstrue
if the items nodetype extends from the configured node type (Node.isNodeType() check).- Overrides:
matches
in classDepthPredicate
- 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)
-
-