com.mongodb.util
Class JSON

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

public class JSON
extends Object

Helper methods for JSON serialization and de-serialization


Constructor Summary
JSON()
           
 
Method Summary
static Object parse(String s)
          Parses a JSON string representing a JSON value
static Object parse(String s, BSONCallback c)
          Parses a JSON string representing a JSON value
static String serialize(Object o)
          Serializes an object into it's JSON form
static void serialize(Object o, 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 String serialize(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(Object o,
                             StringBuilder buf)

parse

public static Object parse(String s)
Parses a JSON string representing a JSON value

Parameters:
s - the string to parse
Returns:
the object

parse

public static Object parse(String s,
                           BSONCallback c)
Parses a JSON string representing a JSON value

Parameters:
s - the string to parse
Returns:
the object