| Modifier and Type | Field and Description |
|---|---|
static XMLParserConfiguration |
XMLParserConfiguration.KEEP_STRINGS
Original configuration of the XML Parser except that values are kept as strings.
|
static XMLParserConfiguration |
XMLParserConfiguration.ORIGINAL
Original Configuration of the XML Parser.
|
| Modifier and Type | Method and Description |
|---|---|
protected XMLParserConfiguration |
XMLParserConfiguration.clone()
Provides a new instance of the same configuration.
|
XMLParserConfiguration |
XMLParserConfiguration.withcDataTagName(String newVal)
The name of the key in a JSON Object that indicates a CDATA section.
|
XMLParserConfiguration |
XMLParserConfiguration.withCloseEmptyTag(boolean closeEmptyTag)
To enable explicit end tag with empty value.
|
XMLParserConfiguration |
XMLParserConfiguration.withConvertNilAttributeToNull(boolean newVal)
When parsing the XML into JSON, specifies if values with attribute xsi:nil="true"
should be kept as attribute(
false), or they should be converted to
null(true) |
XMLParserConfiguration |
XMLParserConfiguration.withForceList(Set<String> forceList)
When parsing the XML into JSON, specifies that tags that will be converted to arrays
in this configuration
Set<String> to parse the provided tags' values as arrays |
XMLParserConfiguration |
XMLParserConfiguration.withKeepStrings(boolean newVal)
When parsing the XML into JSON, specifies if values should be kept as strings (
true), or if
they should try to be guessed into JSON values (numeric, boolean, string) |
XMLParserConfiguration |
XMLParserConfiguration.withMaxNestingDepth(int maxNestingDepth)
Defines the maximum nesting depth that the parser will descend before throwing an exception
when parsing the XML into JSON.
|
XMLParserConfiguration |
XMLParserConfiguration.withShouldTrimWhitespace(boolean shouldTrimWhiteSpace)
Sets whether whitespace should be trimmed inside of tags.
|
XMLParserConfiguration |
XMLParserConfiguration.withXsiTypeMap(Map<String,XMLXsiTypeConverter<?>> xsiTypeMap)
When parsing the XML into JSON, specifies that the values with attribute xsi:type
will be converted to target type defined to client in this configuration
Map<String, XMLXsiTypeConverter<?>> to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as string |
| Modifier and Type | Method and Description |
|---|---|
static JSONObject |
XML.toJSONObject(Reader reader,
XMLParserConfiguration config)
Convert a well-formed (but not necessarily valid) XML into a
JSONObject.
|
static JSONObject |
XML.toJSONObject(String string,
XMLParserConfiguration config)
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject.
|
static String |
XML.toString(Object object,
String tagName,
XMLParserConfiguration config)
Convert a JSONObject into a well-formed, element-normal XML string.
|
static String |
XML.toString(Object object,
String tagName,
XMLParserConfiguration config,
int indentFactor)
Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
|
| Constructor and Description |
|---|
XMLTokener(Reader r,
XMLParserConfiguration configuration)
Construct an XMLTokener from a Reader and an XMLParserConfiguration.
|
Copyright © 2024. All rights reserved.