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