Package com.adobe.acs.commons.json
Class AbstractJSONObjectVisitor
java.lang.Object
com.adobe.acs.commons.json.AbstractJSONObjectVisitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(com.google.gson.JsonArray jsonArray) Visit the given JSON Array and all its descendants.voidaccept(com.google.gson.JsonObject jsonObject) Visit the given JSON Object and all its descendants.intprotected final voidtraverseJSONArray(com.google.gson.JsonArray jsonArray) Visit each JSON Object in the JSON Array.protected final voidtraverseJSONObject(com.google.gson.JsonObject jsonObject) Visit each JSON Object in the JSON Array.protected abstract voidvisit(com.google.gson.JsonObject jsonObject) Implement this method to do actual work on the JSON Object.
-
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
-