As promised, I have eventually got around to writing the final part of the JSON trilogy, although maybe I should have waited until Friday the 13th
Along with the new JSONValidator class, I have also added validating versions of the existing JSONReader and JSONWriter classes so that those who wish to always validate can do so in a simple manner. By default the validator generates a simple error summary to standard output, although this behaviour is easily overridden by supplying a custom implementation of JSONErrorListener. As usual there are plenty of test cases to take a look at to see examples of how to use the various classes, and there are no external dependencies to you can plug these classes into your apps or frameworks without disturbing or requiring anything else.
All the files in the Stringtree JSON suite are currently available from subversion at
the tests are available from subversion at
or if you just want the meat, you can download the files individually:
- JSONReader.java
- JSONWriter.java
- JSONValidator.java
- JSONErrorListener.java
- JSONStdoutListener.java
- JSONValidatingReader.java
- JSONValidatingWriter.java
Please check these out if you are interested in a fast, lean Java JSON implementation. I’d love to hear any comments and suggestions, ideally before I include these files in the next release of Stringtree.
Posted by Stringtree in JSON, Projects
