Class DepthItemFilter
java.lang.Object
org.apache.jackrabbit.vault.fs.filter.DepthItemFilter
- All Implemented Interfaces:
Dumpable,Filter,ItemFilter
- Direct Known Subclasses:
DeclaringTypeItemFilter,FileFolderNodeFilter,IsMandatoryFilter,IsNodeFilter,NameItemFilter,NodeTypeItemFilter
Implements a filter that filters item according to their (passed) depth.
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.vault.fs.api.ItemFilter
ALL, NONE -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.DepthItemFilter(int minDepth, int maxDepth) Creates a new depth filter for the given depths. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(DumpContext ctx, boolean isLast) Dumps some human readable information using the given context.booleanReturnstrue.booleanChecks if the given item matches this filters criteria.voidsetMaxDepth(String maxDepth) Sets the maximal depthvoidsetMinDepth(String minDepth) Sets the minimal depth
-
Constructor Details
-
DepthItemFilter
public DepthItemFilter()Default constructor. -
DepthItemFilter
public DepthItemFilter(int minDepth, int maxDepth) Creates a new depth filter for the given depths.- Parameters:
minDepth- the minimal depthmaxDepth- the maximal depth
-
-
Method Details
-
setMinDepth
Sets the minimal depth- Parameters:
minDepth- the minimal depth
-
setMaxDepth
Sets the maximal depth- Parameters:
maxDepth- the maximal depth
-
matches
Checks if the given item matches this filters criteria. The given depth is relative to some invoker related depth and may not reflect the hierarchical depth of the item in the repository. It up to the implementation how to deal with this value. 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:
matchesin interfaceItemFilter- Parameters:
item- the item to checkdepth- a relative depth.- Returns:
trueif this filter matches the criteria;falseotherwise.- Throws:
RepositoryException- if an error occurs.
-
matches
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.
-
dump
Dumps some human readable information using the given context.
-