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:
RPCError,RPCRequest, andRPCResponse - Added support for comments in JSON syntax, prefixed by a '#' hash mark (octothorpe)
- Added utility methods,
JSONObject.keySet()andJSONObject.putAll()
This library should be backward compatible with any projects that used the JSON.org reference implementation.
Comments (prefixed with '#') are supported, and useful for documenting hand-edited JSON files. However, comments are ignored (not preserved) while parsing JSON, so if you later call JSONObject.toString(), there will be no comments. Since comments are not part of the official JSON specification, you will just have to ignore any corresponding syntax errors flagged by your 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-2025 Augur Systems, Inc.
See individual files for specifics.