This parser is primaryly written to generate formated Json and Html file from Json. Please see the demo link below to make sure this is what you are looking for.
<Demo>
: https://rkumar-bengaluru.github.io/java-json-parser/
A fast and minimal JSON parser and writer for Java. It's not an object mapper, but a bare-bones library that aims at being
- minimal: no dependencies, single package with just a few classes, small download size
- lightweight: object representation with minimal memory footprint
Java-Json-Parser is fully covered by unit tests.
The class RJsonParser
is the entrypoint to the java-json-parser API, use it to parse and to create JSON.
You can parse JSON from a String
or from a java.io.Reader
.
String json = "{\"name\":\"sonoo\",\"salary\":600000.0,\"age\":27}";
RJsonParser instance = new RJsonParser(string);
RJsonObject json = instance.parse();
String json = "{\"name\":\"sonoo\",\"salary\":600000.0,\"age\":27}";
RJsonParser instance = new RJsonParser(json);
StringBuilder builder = new StringBuilder();
instance.parse().toHtml(builder,-1);
The above generates the html file in the current working directory with the file name 'result.html'. Left side is input json file and the right side shows formatted json output. Below is an example output.
To build java-json-parser on your machine, checkout the repository, cd
into it, and call:
gradlew build
MIT Free Software, Hell Yeah!