|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.japano.util.JSON
public class JSON
Tool class with only static methods used to construct JSON representations of nested java object graphs. The object graphs can contain the following components:
Method Summary | |
---|---|
static void |
dumpObject(Buffer out,
java.lang.Object o)
Dumps the given object as JSON representation into the given buffer |
static java.lang.String |
dumpObjectFormatted(java.lang.Object o)
Dumps the given object as formatted JSON representation. |
static java.lang.String |
forValue(java.lang.Object o)
Returns a JSON representation of the given object as String. |
static java.lang.String |
forValue(java.lang.Object o,
boolean formatted)
Returns a JSON representation of the given object as String. |
static void |
send(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object o)
Answers the given request with the given object in JSON representation. |
static void |
send(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object o,
java.lang.String mimeType)
Answers the given request with the given object in JSON representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void send(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object o) throws java.io.IOException
request
- Requestresponse
- Responseo
- Object
java.io.IOException
- if the response can't be send.public static void send(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object o, java.lang.String mimeType) throws java.io.IOException
request
- Requestresponse
- Responseo
- ObjectmimeType
- mime type to use
java.io.IOException
- if the response can't be send.public static java.lang.String dumpObjectFormatted(java.lang.Object o)
o
- Object
public static void dumpObject(Buffer out, java.lang.Object o)
out
- buffero
- objectpublic static java.lang.String forValue(java.lang.Object o)
o
- object
public static java.lang.String forValue(java.lang.Object o, boolean formatted)
o
- objectformatted
- if true
, the JSON object will be split in mulitple lines and indented.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |