public final class JSONUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Node |
jsonObjectToXml(JSONObject jo)
Converts the provide JSONObject into an XML DOM Node representing
the same data.
|
static org.w3c.dom.Node |
jsonObjectToXml(JSONObject jo,
boolean ignoreNamespaces)
Converts the provide JSONObject into an XML DOM Node representing
the same data.
|
static org.w3c.dom.Node |
jsonToXml(java.lang.String json)
Converts the provide JSON string into an XML DOM Node representing
the same data.
|
static java.lang.String |
xmlToJson(org.w3c.dom.Node xml)
Converts the provide XML node into a JSON string representation
of the same data.
|
static JSONObject |
xmlToJsonObject(org.w3c.dom.Node xml)
Converts the provided XML node into a JSONObject representation
of the same data.
|
static JSONObject |
xmlToJsonObject(org.w3c.dom.Node xml,
boolean ignoreNamespaces)
Converts the provided XML node into a JSONObject representation
of the same data.
|
public static java.lang.String xmlToJson(org.w3c.dom.Node xml) throws java.io.IOException
xml
- The DOM Node containing the information to output as JSON.java.io.IOException
- if problem encountered trying to serialize the XML.public static JSONObject xmlToJsonObject(org.w3c.dom.Node xml) throws java.io.IOException
xml
- The DOM Node containing the information to output as JSON.java.io.IOException
- if problem encountered trying to serialize the XML.public static JSONObject xmlToJsonObject(org.w3c.dom.Node xml, boolean ignoreNamespaces) throws java.io.IOException
xml
- The DOM Node containing the information to output as JSON.ignoreNamespaces
- If true, no namespace details will be included in the resulting json object.java.io.IOException
- if problem encountered trying to serialize the XML.public static org.w3c.dom.Node jsonToXml(java.lang.String json)
json
- The JSON String to convert into an XML structure.public static org.w3c.dom.Node jsonObjectToXml(JSONObject jo)
jo
- The JSONObject to convert into an XML structure.public static org.w3c.dom.Node jsonObjectToXml(JSONObject jo, boolean ignoreNamespaces)
jo
- The JSONObject to convert into an XML structure.ignoreNamespaces
- If true, no namespace definitions will be included in the resulting XML.Copyright © 2007 Hyfinity Ltd. All Rights Reserved.