Class ResourceTraversor

java.lang.Object
org.apache.sling.commons.json.sling.ResourceTraversor

@Deprecated public class ResourceTraversor extends Object
Deprecated.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Deprecated.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResourceTraversor(int levels, long maxResources, Resource resource, boolean tidy)
    Deprecated.
    Create a ResourceTraversor, optionally limiting recursion and total number of resources
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated.
    Recursive descent from startResource, collecting JSONObjects into startObject.
    long
    Deprecated.
     
    Deprecated.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ResourceTraversor

      public ResourceTraversor(int levels, long maxResources, Resource resource, boolean tidy) throws JSONException
      Deprecated.
      Create a ResourceTraversor, optionally limiting recursion and total number of resources
      Parameters:
      levels - recursion levels limit, -1 means no limit
      maxResources - maximum number of resources to collect, ignored if levels == 1
      resource - the root resource to traverse
      tidy - not used
      Throws:
      JSONException
  • Method Details

    • collectResources

      public int collectResources() throws RecursionTooDeepException, JSONException
      Deprecated.
      Recursive descent from startResource, collecting JSONObjects into startObject. Throws a RecursionTooDeepException if the maximum number of nodes is reached on a "deep" traversal (where "deep" === level greater than 1).
      Returns:
      -1 if everything went fine, a positive valuew when the resource has more child nodes then allowed.
      Throws:
      JSONException
      RecursionTooDeepException
    • getCount

      public long getCount()
      Deprecated.
      Returns:
      The number of resources this visitor found.
    • getJSONObject

      public JSONObject getJSONObject()
      Deprecated.