Package | Description |
---|---|
org.dromara.hutool.json.xml |
JSON与XML相互转换封装,基于json.org官方库改造
|
Modifier and Type | Method and Description |
---|---|
static ParseConfig |
ParseConfig.of()
创建ParseConfig
|
ParseConfig |
ParseConfig.setKeepStrings(boolean keepStrings)
设置是否保持值为String类型,如果为
false ,则尝试转换为对应类型(numeric, boolean, string) |
ParseConfig |
ParseConfig.setMaxNestingDepth(int maxNestingDepth)
设置最大嵌套深度,用于解析时限制解析层级,当大于这个层级时抛出异常,-1表示无限制
|
Modifier and Type | Method and Description |
---|---|
static JSONXMLParser |
JSONXMLParser.of(ParseConfig parseConfig,
Predicate<MutableEntry<Object,Object>> predicate)
创建XML解析器
|
static JSONObject |
JSONXMLUtil.toJSONObject(String xmlStr,
JSONObject jo,
ParseConfig parseConfig)
转换XML为JSONObject
转换过程中一些信息可能会丢失,JSON中无法区分节点和属性,相同的节点将被处理为JSONArray。
|
static JSONObject |
JSONXMLUtil.toJSONObject(String string,
ParseConfig parseConfig)
转换XML为JSONObject
转换过程中一些信息可能会丢失,JSON中无法区分节点和属性,相同的节点将被处理为JSONArray。
|
Constructor and Description |
---|
JSONXMLParser(ParseConfig parseConfig,
Predicate<MutableEntry<Object,Object>> predicate)
构造
|
Copyright © 2025. All rights reserved.