|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bowstreet.util.JSONUtil
public class JSONUtil
Utility class for working with JSON data.
Constructor Summary | |
---|---|
JSONUtil()
|
Method Summary | |
---|---|
static boolean |
isValid(java.io.Reader reader)
Checks if the data from the specified Reader is valid JSON. |
static boolean |
isValid(java.lang.String json)
Checks if the specified string is valid JSON. |
static IXml |
json2Xml(java.io.Reader reader)
Converts the JSON from the specified Reader to an XML representation. |
static IXml |
json2Xml(java.io.Reader reader,
JSON2XMLHandler handler)
Converts the JSON from the specified Reader to an XML representation. |
static IXml |
json2Xml(java.lang.String json)
Converts the JSON string to an XML representation. |
static IXml |
json2Xml(java.lang.String json,
JSON2XMLHandler handler)
Converts the JSON string to an XML representation. |
static java.lang.String |
xml2JSON(java.io.InputStream xml,
boolean verbose)
Converts the specified xml to a JSON representation. |
static void |
xml2JSON(java.io.InputStream xml,
java.io.OutputStream jsonOutput,
boolean verbose)
Converts the specified xml to a JSON representation. |
static java.lang.String |
xml2JSON(IXml xml,
boolean verbose)
Converts the specified xml to a JSON representation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSONUtil()
Method Detail |
---|
public static boolean isValid(java.io.Reader reader)
reader
- The Reader to fetch the JSON from.
public static boolean isValid(java.lang.String json)
json
- The JSON String
public static IXml json2Xml(java.io.Reader reader)
reader
- The Reader to fetch the JSON from.
public static IXml json2Xml(java.io.Reader reader, JSON2XMLHandler handler)
reader
- The Reader to fetch the JSON from.handler
- A JSON2XMLHandler converter handler.
public static IXml json2Xml(java.lang.String json)
json
- The JSON String
public static IXml json2Xml(java.lang.String json, JSON2XMLHandler handler)
json
- The JSON Stringhandler
- A JSON2XMLHandler converter handler.
public static java.lang.String xml2JSON(java.io.InputStream xml, boolean verbose)
xml
- An InputStream to read the XML fromverbose
- specifies whether verbose formatting including spacing and newlines should be used
public static void xml2JSON(java.io.InputStream xml, java.io.OutputStream jsonOutput, boolean verbose)
xml
- An InputStream to read the XML fromjsonOutput
- An OutputStream to write the converted JSON object to.verbose
- specifies whether verbose formatting including spacing and newlines should be usedpublic static java.lang.String xml2JSON(IXml xml, boolean verbose)
xml
- The IXml representation of the XMLverbose
- specifies whether verbose formatting including spacing and newlines should be used
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |