|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.json.xml.XMLSerializer
public class XMLSerializer
Utility class for transforming JSON to XML an back.
When transforming JSONObject and JSONArray instances to XML, this class will
add hints for converting back to JSON.
Examples:
JSONObject json = JSONObject.fromObject("{\"name\":\"json\",\"bool\":true,\"int\":1}"); String xml = XMLSerializer.write( json );json true 1
JSONArray json = JSONArray.fromObject("[1,2,3]"); String xml = XMLSerializer.write( json );1 2 3
Constructor Summary | |
---|---|
XMLSerializer()
|
Method Summary | |
---|---|
static JSONArray |
readArray(java.lang.String xml)
Creates a JSONArray from a XML string. |
static JSONObject |
readObject(java.lang.String xml)
Creates a JSONObject from a XML string. |
static java.lang.String |
write(JSONArray jsonArray)
Writes a JSONArray into a XML string. |
static java.lang.String |
write(JSONObject jsonObject)
Writes a JSONObject into a XML string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLSerializer()
Method Detail |
---|
public static JSONArray readArray(java.lang.String xml)
public static JSONObject readObject(java.lang.String xml)
public static java.lang.String write(JSONArray jsonArray)
public static java.lang.String write(JSONObject jsonObject)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |