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 booleanevaluate(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 booleanmatches(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:
evaluatein 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:
trueif the item matches;falseotherwise.- Throws:
RepositoryException- if an error occurs.
-
-