Uses of Class
org.json.XMLParserConfiguration
-
Uses of XMLParserConfiguration in org.json
Fields in org.json declared as XMLParserConfigurationModifier and TypeFieldDescriptionprivate XMLParserConfiguration
XMLTokener.configuration
static final XMLParserConfiguration
XMLParserConfiguration.KEEP_STRINGS
Original configuration of the XML Parser except that values are kept as strings.static final XMLParserConfiguration
XMLParserConfiguration.ORIGINAL
Original Configuration of the XML Parser.Methods in org.json that return XMLParserConfigurationModifier and TypeMethodDescriptionprotected XMLParserConfiguration
XMLParserConfiguration.clone()
Provides a new instance of the same configuration.XMLParserConfiguration.withcDataTagName
(String newVal) The name of the key in a JSON Object that indicates a CDATA section.XMLParserConfiguration.withCloseEmptyTag
(boolean closeEmptyTag) To enable explicit end tag with empty value.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 tonull
(true
)XMLParserConfiguration.withForceList
(Set<String> forceList) When parsing the XML into JSON, specifies that tags that will be converted to arrays in this configurationSet<String>
to parse the provided tags' values as arraysXMLParserConfiguration.withKeepBooleanAsString
(boolean newVal) When parsing the XML into JSON, specifies if booleans should be kept as strings (true
), or if they should try to be guessed into JSON values (numeric, boolean, string)XMLParserConfiguration.withKeepNumberAsString
(boolean newVal) When parsing the XML into JSON, specifies if numbers should be kept as strings (1
), or if they should try to be guessed into JSON values (numeric, boolean, string)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.withMaxNestingDepth
(int maxNestingDepth) Defines the maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSON.XMLParserConfiguration.withShouldTrimWhitespace
(boolean shouldTrimWhiteSpace) Sets whether whitespace should be trimmed inside of tags.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 configurationMap<String, XMLXsiTypeConverter<?>>
to parse values with attribute xsi:type="integer" as integer, xsi:type="string" as stringMethods in org.json with parameters of type XMLParserConfigurationModifier and TypeMethodDescriptionprivate static boolean
XML.parse
(XMLTokener x, JSONObject context, String name, XMLParserConfiguration config, int currentNestingDepth) Scan the content following the named tag, attaching it to the context.private static void
XML.removeEmpty
(JSONObject jsonObject, XMLParserConfiguration config) This method removes any JSON entry which has the key set by XMLParserConfiguration.cDataTagName and contains whitespace as this is caused by whitespace between tags.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.private static String
XML.toString
(Object object, String tagName, XMLParserConfiguration config, int indentFactor, int indent) Convert a JSONObject into a well-formed, element-normal XML string, either pretty print or single-lined depending on indent factor.Constructors in org.json with parameters of type XMLParserConfigurationModifierConstructorDescriptionXMLTokener
(Reader r, XMLParserConfiguration configuration) Construct an XMLTokener from a Reader and an XMLParserConfiguration.