JSON Parser and Generator.
This class provides some static methods to convert POJOs to and from JSON notation. The mapping from JSON to java is:
object ==> Map array ==> Object[] number ==> Double or Long string ==> String null ==> null bool ==> Boolean
The java to JSON mapping is:
String --> string Number --> number Map --> object List --> array Array --> array null --> null Boolean--> boolean Object --> string (dubious!)
The interface {@link JSON.Convertible} may be implemented by classes that wish to externalize and initialize specific fields to and from JSON objects. Only directed acyclic graphs of objects are supported.
The interface {@link JSON.Generator} may be implemented by classes that know how to render themselves as JSON andthe {@link #toString(Object)} method will use {@link JSON.Generator#addJSON(StringBuffer)} to generate the JSON.The class {@link JSON.Literal} may be used to hold pre-gnerated JSON object.
The interface {@link Convertor} may be implemented to provide static convertors for objects that may be registered with {@link #registerConvertor(Class,org.mortbay.util.ajax.JSON.Convertor)}. These convertors are looked up by class, interface and super class by {@link #getConvertor(Class)}.
@author gregw