Package com.mongodb.util
Class JSON
- java.lang.Object
 - 
- com.mongodb.util.JSON
 
 
- 
Deprecated.This class has been superseded by to toJson and parse methods on BasicDBObject
@Deprecated public class JSON extends Object
Helper methods for JSON serialization and de-serialization 
- 
- 
Constructor Summary
Constructors Constructor Description JSON()Deprecated. 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Objectparse(String jsonString)Deprecated.Parses a JSON string and returns a corresponding Java object.static Objectparse(String s, BSONCallback c)Deprecated.Parses a JSON string and constructs a corresponding Java object by calling the methods of aBSONCallbackduring parsing.static Stringserialize(Object object)Deprecated.Serializes an object into its JSON form.static voidserialize(Object object, StringBuilder buf)Deprecated.Serializes an object into its JSON form. 
 - 
 
- 
- 
Method Detail
- 
serialize
public static String serialize(Object object)
Deprecated.Serializes an object into its JSON form.
This method delegates serialization to
JSONSerializers.getLegacy- Parameters:
 object- object to serialize- Returns:
 - String containing JSON form of the object
 - See Also:
 JSONSerializers.getLegacy()
 
- 
serialize
public static void serialize(Object object, StringBuilder buf)
Deprecated.Serializes an object into its JSON form.
This method delegates serialization to
JSONSerializers.getLegacy- Parameters:
 object- object to serializebuf- StringBuilder containing the JSON representation under construction- See Also:
 JSONSerializers.getLegacy()
 
- 
parse
public static Object parse(String jsonString)
Deprecated.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.Booleanfortrueorfalsejava.lang.Integerfor integers between Integer.MIN_VALUE and Integer.MAX_VALUEjava.lang.Longfor integers outside of this rangejava.lang.Doublefor floating point numbers
java.lang.String. Parses a JSON string representing a JSON value- Parameters:
 jsonString- the string to parse- Returns:
 - a Java object representing the JSON data
 - Throws:
 JSONParseException- if jsonString is not valid JSON
 
- 
parse
public static Object parse(String s, BSONCallback c)
Deprecated.Parses a JSON string and constructs a corresponding Java object by calling the methods of aBSONCallbackduring parsing. If the callbackcis null, this method is equivalent toparse(String).- Parameters:
 s- the string to parsec- the BSONCallback to call during parsing- Returns:
 - a Java object representing the JSON data
 - Throws:
 JSONParseException- if s is not valid JSON
 
 - 
 
 -