Class DepthPredicate
- java.lang.Object
-
- org.apache.jackrabbit.commons.predicate.DepthPredicate
-
- All Implemented Interfaces:
Predicate
- Direct Known Subclasses:
DeclaringTypePredicate
,IsMandatoryPredicate
,IsNodePredicate
,NamePredicate
,NodeTypePredicate
public class DepthPredicate extends Object implements Predicate
Implements a filter that filters item according to their (passed) depth.
-
-
Constructor Summary
Constructors Constructor Description DepthPredicate(int minDepth, int maxDepth)
Creates a new depth filter for the given depths.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
evaluate(Object item)
Matches if the given depth is greater or equal the minimum depth and less or equal the maximum depth and if the call tomatches(Item)
returnstrue
.protected boolean
matches(Item item)
Returnstrue
.
-
-
-
Method Detail
-
evaluate
public boolean evaluate(Object item)
Matches if the given depth is greater or equal the minimum depth and less or equal the maximum depth and if the call tomatches(Item)
returnstrue
.- Specified by:
evaluate
in interfacePredicate
- Parameters:
item
- some object- Returns:
- predicate result
- See Also:
Predicate.evaluate(java.lang.Object)
-
matches
protected boolean matches(Item item) throws RepositoryException
Returnstrue
. Subclasses can override to implement something useful that is dependant of the depth.- Parameters:
item
- the item to match- Returns:
true
if the item matches;false
otherwise.- Throws:
RepositoryException
- if an error occurs.
-
-