This is a fork of the reference implementation by Douglas Crockford, provided at JSON.org, (which is based on ECMA-404, "The JSON Data Interchange Standard" and also documented as RFC 4627). When Mr. Crockford was asked by us to include RPC, he succinctly replied, "I don't believe in RPC." However, he welcomed any forks. This is this result.
There are three additions to the base code:
- Added three classes to support JSON-RPC v2.0:
- Added support for comments in JSON syntax, when a line begins (No leading white space!) with a hash mark ('#')
- Added utility methods,
This library should be backward compatible with any projects that used the JSON.org reference implementation.
My implementation of comments is limited to "a '#' at column zero" in order to minimally change the reference implementation's parsing code. Note that comments are ignored (not preserved) while parsing JSON, so if you later call
JSONObject.toString(), there will be no comments. Note that comments are not part of the official JSON specification, so you'll just have to ignore any corresponding syntax errors flagged by your JSON file editor.
The ANT build script offers two build sub-targets. The "build-core" target creates "json.jar" comprised of just the JSON and JSON-RPC classes. That's all you need for most JSON work.
The "build-plus" target creates "json+.jar" which includes the same core classes, plus extras that were included in the original JSON.org library, specifically: JSON translations for XML, CDL (comma-delimited list), and HTTP headers.
Just run 'ant' inside the 'build' directory to build both. The core json.jar is 40% smaller than the json+.jar file. (Obviously you only need one in your classpath.)
The original work (most Java source files) are Copyright 2002 JSON.org.
Additional work is Copyright 2010-2016 Augur Systems, Inc.
See individual files for specifics.