Package org.json

Class ParserConfiguration

java.lang.Object
org.json.ParserConfiguration
Direct Known Subclasses:
JSONMLParserConfiguration, XMLParserConfiguration

@Deprecated public class ParserConfiguration extends Object
Deprecated.
Configuration base object for parsers. The configuration is immutable.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deprecated.
    The default maximum nesting depth when parsing a document.
    static final int
    Deprecated.
    Used to indicate there's no defined limit to the maximum nesting depth when parsing a document.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated.
    The maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSONML.
    boolean
    Deprecated.
    When parsing the XML into JSONML, specifies if values should be kept as strings (true), or if they should try to be guessed into JSON values (numeric, boolean, string)
    <T extends ParserConfiguration>
    T
    withKeepStrings(boolean newVal)
    Deprecated.
    When parsing the XML into JSONML, specifies if values should be kept as strings (true), or if they should try to be guessed into JSON values (numeric, boolean, string)
    <T extends ParserConfiguration>
    T
    withMaxNestingDepth(int maxNestingDepth)
    Deprecated.
    Defines the maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSONML.

    Methods inherited from class java.lang.Object

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

    • UNDEFINED_MAXIMUM_NESTING_DEPTH

      public static final int UNDEFINED_MAXIMUM_NESTING_DEPTH
      Deprecated.
      Used to indicate there's no defined limit to the maximum nesting depth when parsing a document.
      See Also:
    • DEFAULT_MAXIMUM_NESTING_DEPTH

      public static final int DEFAULT_MAXIMUM_NESTING_DEPTH
      Deprecated.
      The default maximum nesting depth when parsing a document.
      See Also:
  • Constructor Details

    • ParserConfiguration

      public ParserConfiguration()
      Deprecated.
  • Method Details

    • isKeepStrings

      public boolean isKeepStrings()
      Deprecated.
      When parsing the XML into JSONML, specifies if values should be kept as strings (true), or if they should try to be guessed into JSON values (numeric, boolean, string)
      Returns:
      The keepStrings configuration value.
    • withKeepStrings

      public <T extends ParserConfiguration> T withKeepStrings(boolean newVal)
      Deprecated.
      When parsing the XML into JSONML, specifies if values should be kept as strings (true), or if they should try to be guessed into JSON values (numeric, boolean, string)
      Parameters:
      newVal - new value to use for the keepStrings configuration option.
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
    • getMaxNestingDepth

      public int getMaxNestingDepth()
      Deprecated.
      The maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSONML.
      Returns:
      the maximum nesting depth set for this configuration
    • withMaxNestingDepth

      public <T extends ParserConfiguration> T withMaxNestingDepth(int maxNestingDepth)
      Deprecated.
      Defines the maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSONML. The default max nesting depth is 512, which means the parser will throw a JsonException if the maximum depth is reached. Using any negative value as a parameter is equivalent to setting no limit to the nesting depth, which means the parses will go as deep as the maximum call stack size allows.
      Parameters:
      maxNestingDepth - the maximum nesting depth allowed to the XML parser
      Returns:
      The existing configuration will not be modified. A new configuration is returned.