com.mongodb.util
Class JSON

java.lang.Object
  extended by com.mongodb.util.JSON

public class JSON
extends java.lang.Object

Helper methods for JSON serialization and de-serialization


Constructor Summary
JSON()
           
 
Method Summary
static java.lang.Object parse(java.lang.String s)
          Parses a JSON string into a DBObject.
static java.lang.Object parse(java.lang.String s, BSONCallback c)
          Parses a JSON string into a DBObject.
static java.lang.String serialize(java.lang.Object o)
          Serializes an object into it's JSON form
static void serialize(java.lang.Object o, java.lang.StringBuilder buf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSON

public JSON()
Method Detail

serialize

public static java.lang.String serialize(java.lang.Object o)
Serializes an object into it's JSON form

Parameters:
o - object to serialize
Returns:
String containing JSON form of the object

serialize

public static void serialize(java.lang.Object o,
                             java.lang.StringBuilder buf)

parse

public static java.lang.Object parse(java.lang.String s)
Parses a JSON string into a DBObject.

Parameters:
s - the string to serialize
Returns:
DBObject the object

parse

public static java.lang.Object parse(java.lang.String s,
                                     BSONCallback c)
Parses a JSON string into a DBObject.

Parameters:
s - the string to serialize
Returns:
DBObject the object