org.apache.sling.api.resource
Class AbstractResourceVisitor

java.lang.Object
  extended by org.apache.sling.api.resource.AbstractResourceVisitor

public abstract class AbstractResourceVisitor
extends java.lang.Object

The AbstractResourceVisitor helps in traversing a resource tree by decoupling the actual traversal code from application code. Concrete subclasses should implement the ResourceVisitor#visit(Resource) method.

Since:
2.2

Constructor Summary
AbstractResourceVisitor()
           
 
Method Summary
 void accept(Resource res)
          Visit the given resource and all its descendants.
protected  void traverseChildren(java.util.Iterator<Resource> children)
          Visit the given resources.
protected abstract  void visit(Resource res)
          Implement this method to do actual work on the resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceVisitor

public AbstractResourceVisitor()
Method Detail

accept

public void accept(Resource res)
Visit the given resource and all its descendants.

Parameters:
res - The resource

traverseChildren

protected void traverseChildren(java.util.Iterator<Resource> children)
Visit the given resources.

Parameters:
children - The list of resources

visit

protected abstract void visit(Resource res)
Implement this method to do actual work on the resources.

Parameters:
res - The resource


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.