@Deprecated
public class JSON
extends java.lang.Object
| Constructor and Description |
|---|
JSON()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
parse(java.lang.String jsonString)
Deprecated.
Parses a JSON string and returns a corresponding Java object.
|
static java.lang.Object |
parse(java.lang.String s,
BSONCallback c)
Deprecated.
Parses a JSON string and constructs a corresponding Java object by calling the methods of a
BSONCallback during parsing. |
static java.lang.String |
serialize(java.lang.Object object)
Deprecated.
Serializes an object into its JSON form.
|
static void |
serialize(java.lang.Object object,
java.lang.StringBuilder buf)
Deprecated.
Serializes an object into its JSON form.
|
public static java.lang.String serialize(java.lang.Object object)
Serializes an object into its JSON form.
This method delegates serialization to JSONSerializers.getLegacy
object - object to serializeJSONSerializers.getLegacy()public static void serialize(java.lang.Object object,
java.lang.StringBuilder buf)
Serializes an object into its JSON form.
This method delegates serialization to JSONSerializers.getLegacy
object - object to serializebuf - StringBuilder containing the JSON representation under constructionJSONSerializers.getLegacy()public static java.lang.Object parse(java.lang.String jsonString)
Parses a JSON string and returns a corresponding Java object. The returned value is either a DBObject
(if the string is a JSON object or array), or a boxed primitive value according to the following mapping:
java.lang.Boolean for true or falsejava.lang.Integer for integers between Integer.MIN_VALUE and Integer.MAX_VALUEjava.lang.Long for integers outside of this rangejava.lang.Double for floating point numbersjava.lang.String. Parses a JSON string representing a JSON valuejsonString - the string to parseJSONParseException - if jsonString is not valid JSONpublic static java.lang.Object parse(java.lang.String s,
BSONCallback c)
BSONCallback during parsing. If the callback c is null, this method is equivalent to parse(String).s - the string to parsec - the BSONCallback to call during parsingJSONParseException - if s is not valid JSON