Documentation of 'org.json.XMLParserConfiguration' Java class
XMLParserConfiguration
org.json

Class XMLParserConfiguration



  • public class XMLParserConfiguration
    extends java.lang.Object
    Configuration object for the XML parser.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.lang.String cDataTagName
      The name of the key in a JSON Object that indicates a CDATA section.
      static XMLParserConfiguration KEEP_STRINGS
      Original configuration of the XML Parser except that values are kept as strings.
      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)
      static XMLParserConfiguration ORIGINAL
      Original 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.
    • Method Summary

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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. Use null to 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 - true to parse all values as string. false to 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. Pass null to disable CDATA processing
        Parameters:
        cDataTagNamenull - to disable CDATA processing. Any other value to use that value as the JSONObject key name to process as CDATA.
      • XMLParserConfiguration

        public XMLParserConfiguration(boolean keepStrings,
                                      java.lang.String cDataTagName)
        Configure the parser to use custom settings.
        Parameters:
        keepStrings - true to parse all values as string. false to try and convert XML string values into a JSON value.
        cDataTagNamenull - to disable CDATA processing. Any other value to use that value as the JSONObject key name to process as CDATA.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.