public abstract class AbstractResourceVisitor
extends java.lang.Object
visit(Resource)
method for each visited resource.
It decouples the actual traversal code from application code.
Concrete subclasses must implement the visit(Resource)
method.
There is no possibility to stop traversal in this visitor. If you want to skip certain
parts of the subtree or stop traversal at a certain point rather use
ResourceStream
or
ResourceFilterStream
.Constructor and Description |
---|
AbstractResourceVisitor() |
Modifier and Type | Method and Description |
---|---|
void |
accept(Resource res)
Visit the given resource and all its descendants.
|
protected void |
traverseChildren(@NotNull java.util.Iterator<Resource> children)
Visit the given resources.
|
protected abstract void |
visit(@NotNull Resource res)
Implement this method to do actual work on the resources.
|
public void accept(Resource res)
res
- The resourceprotected void traverseChildren(@NotNull @NotNull java.util.Iterator<Resource> children)
children
- The list of resourcesprotected abstract void visit(@NotNull @NotNull Resource res)
res
- The resourceCopyright © 2022 The Apache Software Foundation. All rights reserved.