net.minidev.json.actions.traverse.KeysPrintAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-smart-action Show documentation
Show all versions of json-smart-action Show documentation
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
package net.minidev.json.actions.traverse;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
import java.util.Map.Entry;
/**
* @author [email protected]
* @since 5/24/16.
*/
public class KeysPrintAction implements JSONTraverseAction {
@Override
public boolean start(JSONObject object) {
return true;
}
@Override
public boolean traverseEntry(String fullPathToEntry, Entry entry) {
// System.out.println(entry.getKey());
return true;
}
@Override
public boolean recurInto(String pathToEntry, JSONObject entryValue) {
return true;
}
@Override
public boolean recurInto(String pathToEntry, JSONArray entryValue) {
return true;
}
@Override
public void handleLeaf(String pathToEntry, Entry entry) {
}
@Override
public void handleLeaf(String fullPathToContainingList, int listIndex, Object listItem) {
}
@Override
public boolean removeEntry(String fullPathToEntry, Entry entry) {
return false;
}
@Override
public void end() {
}
@Override
public Object result() {
return null;
}
}