Class AbstractJSONObjectVisitor

java.lang.Object
com.adobe.acs.commons.json.AbstractJSONObjectVisitor

public abstract class AbstractJSONObjectVisitor extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(com.google.gson.JsonArray jsonArray)
    Visit the given JSON Array and all its descendants.
    void
    accept(com.google.gson.JsonObject jsonObject)
    Visit the given JSON Object and all its descendants.
    int
     
    protected final void
    traverseJSONArray(com.google.gson.JsonArray jsonArray)
    Visit each JSON Object in the JSON Array.
    protected final void
    traverseJSONObject(com.google.gson.JsonObject jsonObject)
    Visit each JSON Object in the JSON Array.
    protected abstract void
    visit(com.google.gson.JsonObject jsonObject)
    Implement this method to do actual work on the JSON Object.

    Methods inherited from class java.lang.Object

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

    • AbstractJSONObjectVisitor

      public AbstractJSONObjectVisitor()
  • Method Details

    • getCurrentDepth

      public int getCurrentDepth()
    • accept

      public void accept(com.google.gson.JsonObject jsonObject)
      Visit the given JSON Object and all its descendants.
      Parameters:
      jsonObject - The JSON Object
    • accept

      public void accept(com.google.gson.JsonArray jsonArray)
      Visit the given JSON Array and all its descendants.
      Parameters:
      jsonArray - The JSON Object
    • traverseJSONObject

      protected final void traverseJSONObject(com.google.gson.JsonObject jsonObject)
      Visit each JSON Object in the JSON Array.
      Parameters:
      jsonObject - The JSON Array
    • traverseJSONArray

      protected final void traverseJSONArray(com.google.gson.JsonArray jsonArray)
      Visit each JSON Object in the JSON Array.
      Parameters:
      jsonArray - The JSON Array
    • visit

      protected abstract void visit(com.google.gson.JsonObject jsonObject)
      Implement this method to do actual work on the JSON Object.
      Parameters:
      jsonObject - The JSON Object