The Wayback Machine - https://web.archive.org/web/20100103020933/http://argo.sourceforge.net:80/

Introduction

Argo is a JSON parser and generator for Java. It offers three parse interfaces - a push parser, a pull parser, and a DOM syle 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 1.1. 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.

{ "name": "Black Lace", "sales": 110921, "singles": [ "Superman", "Agadoo" ] }

We can use Argo to get the second single like this:

JsonNode json = new JdomParser().parse(jsonText); String secondSingle = JsonNodeSelectors.aStringNode("singles", 1) .getValue(json);

On the first line, we parse the JSON text into an object hierarchy. We could have navigated this ourselves, but in this case, it's easier to let a JsonNodeSelector take the strain.

On line two, we make a selector that selects the JSON string at index 1 of the array in the singles field. We then apply this selector to the root object to get back the value of the string.

If we check the secondSingle variable, we will find, as expected, it contains the String "Agadoo".