public class JSONXMLSerializer extends Object
| Constructor and Description |
|---|
JSONXMLSerializer() |
| Modifier and Type | Method and Description |
|---|---|
static String |
toXml(JSON json)
转换JSONObject为XML
Convert a JSONObject into a well-formed, element-normal XML string.
|
static String |
toXml(JSON json,
String tagName)
转换JSONObject为XML
|
static String |
toXml(JSON json,
String tagName,
String... contentKeys)
转换JSONObject为XML
|
public static String toXml(JSON json) throws JSONException
json - A JSONObject.JSONException - Thrown if there is an error parsing the stringpublic static String toXml(JSON json, String tagName) throws JSONException
json - JSON对象或数组tagName - 可选标签名称,名称为空时忽略标签JSONException - JSON解析异常public static String toXml(JSON json, String tagName, String... contentKeys) throws JSONException
json - JSON对象或数组tagName - 可选标签名称,名称为空时忽略标签contentKeys - 标识为内容的key,遇到此key直接解析内容而不增加对应名称标签JSONException - JSON解析异常Copyright © 2025. All rights reserved.