org.json
Class XMLParserConfiguration
- java.lang.Object
-
- org.json.XMLParserConfiguration
-
public class XMLParserConfiguration extends java.lang.ObjectConfiguration object for the XML parser.
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.StringcDataTagNameThe name of the key in a JSON Object that indicates a CDATA section.static XMLParserConfigurationKEEP_STRINGSOriginal configuration of the XML Parser except that values are kept as strings.booleankeepStringsWhen 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)static XMLParserConfigurationORIGINALOriginal Configuration of the XML Parser.
-
Constructor Summary
Constructors Constructor and Description XMLParserConfiguration()Default parser configuration.XMLParserConfiguration(boolean keepStrings)Configure the parser string processing and use the default CDATA Tag Name as "content".XMLParserConfiguration(boolean keepStrings, java.lang.String cDataTagName)Configure the parser to use custom settings.XMLParserConfiguration(java.lang.String cDataTagName)Configure the parser string processing to try and convert XML values to JSON values and use the passed CDATA Tag Name the processing value.
-
-
-
Field Detail
-
ORIGINAL
public static final XMLParserConfiguration ORIGINAL
Original Configuration of the XML Parser.
-
KEEP_STRINGS
public static final XMLParserConfiguration KEEP_STRINGS
Original configuration of the XML Parser except that values are kept as strings.
-
keepStrings
public final boolean keepStrings
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)
-
cDataTagName
public final java.lang.String cDataTagName
The name of the key in a JSON Object that indicates a CDATA section. Historically this has been the value "content" but can be changed. Usenullto indicate no CDATA processing.
-
-
Constructor Detail
-
XMLParserConfiguration
public XMLParserConfiguration()
Default parser configuration. Does not keep strings, and the CDATA Tag Name is "content".
-
XMLParserConfiguration
public XMLParserConfiguration(boolean keepStrings)
Configure the parser string processing and use the default CDATA Tag Name as "content".- Parameters:
keepStrings-trueto parse all values as string.falseto try and convert XML string values into a JSON value.
-
XMLParserConfiguration
public XMLParserConfiguration(java.lang.String cDataTagName)
Configure the parser string processing to try and convert XML values to JSON values and use the passed CDATA Tag Name the processing value. Passnullto disable CDATA processing- Parameters:
cDataTagName- to disable CDATA processing. Any other value to use that value as the JSONObject key name to process as CDATA.null
-
XMLParserConfiguration
public XMLParserConfiguration(boolean keepStrings, java.lang.String cDataTagName)Configure the parser to use custom settings.- Parameters:
keepStrings-trueto parse all values as string.falseto try and convert XML string values into a JSON value.cDataTagName- to disable CDATA processing. Any other value to use that value as the JSONObject key name to process as CDATA.null
-
-
DataMelt 3.0 © DataMelt by jWork.ORG