Introduction
Argo is a JSON parser and generator compliant with RFC 7159 for Java. It offers three parse interfaces - a push parser, a pull parser, and a DOM style parser. It is written to be easy to use, typesafe, and fast. It is open source, and free for you to use.
The latest version of Argo available for download is 6.5. The javadoc is also available online.
Example
A brief example demonstrates the DOM style parser. The example is based on the following JSON, which is assumed to be available in a String
called jsonText
.
We can use Argo to get the second single like this:
On the first line, we parse the JSON text into an object hierarchy. There are various options for navigating this, but the simplest is just to give the path and type of node we expect.
On line two, we ask for the JSON string at index 1 of the array in the singles
field.
If we check the secondSingle
variable, we will find, as expected, it contains the String
"Agadoo
".