org.apache.sling.servlets.get.impl.helpers
Class ResourceTraversor
java.lang.Object
org.apache.sling.servlets.get.impl.helpers.ResourceTraversor
public class ResourceTraversor
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceTraversor
public ResourceTraversor(int levels,
long maxNodes,
Resource resource,
boolean tidy)
throws javax.jcr.RepositoryException,
JSONException
- Throws:
javax.jcr.RepositoryException
JSONException
check
public void check()
throws javax.jcr.RepositoryException,
RecursionTooDeepException,
JSONException
- Check if the resource has less child nodes for the specified amount of levels.
- Throws:
javax.jcr.RepositoryException
RecursionTooDeepException
- When the resource has more child nodes then allowed.
JSONException
collectResource
protected void collectResource(Resource resource,
int level)
throws javax.jcr.RepositoryException,
JSONException
- Adds a resource in the JSON tree.
- Parameters:
resource
- The resource to addlevel
- The level where this resource is located.
- Throws:
javax.jcr.RepositoryException
JSONException
getCount
public long getCount()
- Returns:
- The number of nodes this visitor found.
setMaxNodes
public void setMaxNodes(long maxNodes)
- Parameters:
maxNodes
- the maxNodes to set
getMaxNodes
public long getMaxNodes()
- Returns:
- the maxNodes
getJSONObject
public JSONObject getJSONObject()
Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.