Welcome to Json-lib
JSON-lib is a java library for transforming beans, maps, collections,
java arrays to JSON and back again to beans and DynaBeans.
It is based on the work by Douglas Crockford
in https://www.json.org/java.
The following tables sumarizes the types conversion between java and
javascript:
JSON | Java | |
---|---|---|
string | <=> | java.lang.String, java.lang.Character, char |
number | <=> | java.lang.Number, byte, short, int, long, float, double |
true|false | <=> | java.lang.Boolean, boolean |
null | <=> | null |
array | <=> | net.sf.json.JSONArray (object, string, number, boolean) |
object | <=> | net.sf.json.JSONObject |
This library strictly follows the JSON specification and only supports the official (please refer to https://www.json.org) JSON data types.
Json-lib comes in two flavors, depending on the jdk compatibility. json-lib-x.x-jdk13 is compatible with JDK 1.3.1 and upwards. json-lib-x.x-jdk15 is compatible with JDK 1.5, includes support for Enums in JSONArray and JSONObject. Please reffer to the appropriate javadoc links available in the project menu.
Json-lib requires (at least) the following dependencies in your classpath:
- jakarta commons-beanutils 1.8.0
- ezmorph 1.0.6
What is JSON ?
JSON (JavaScript Object Notation) is a lightweight
data-interchange format. It is easy for humans to read
and write. It is easy for machines to parse and
generate. It is based on a subset of the JavaScript
Programming Language, Standard ECMA-262 3rd Edition -
December 1999. JSON is a text format that is completely
language independent but uses conventions that are
familiar to programmers of the C-family of languages,
including C, C++, C#, Java, JavaScript, Perl, Python,
and many others.
These properties make JSON an ideal data-interchange
language.