public class ParserConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAXIMUM_NESTING_DEPTH
The default maximum nesting depth when parsing a document.
|
protected boolean |
keepStrings
Specifies if values should be kept as strings (
true ), or if
they should try to be guessed into JSON values (numeric, boolean, string) |
protected int |
maxNestingDepth
The maximum nesting depth when parsing a document.
|
static int |
UNDEFINED_MAXIMUM_NESTING_DEPTH
Used to indicate there's no defined limit to the maximum nesting depth when parsing a document.
|
Modifier | Constructor and Description |
---|---|
|
ParserConfiguration()
Constructs a new ParserConfiguration with default settings.
|
protected |
ParserConfiguration(boolean keepStrings,
int maxNestingDepth)
Constructs a new ParserConfiguration with the specified settings.
|
Modifier and Type | Method and Description |
---|---|
protected ParserConfiguration |
clone()
Provides a new instance of the same configuration.
|
int |
getMaxNestingDepth()
The maximum nesting depth that the parser will descend before throwing an exception
when parsing the XML into JSONML.
|
boolean |
isKeepStrings()
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> |
withKeepStrings(boolean newVal)
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> |
withMaxNestingDepth(int maxNestingDepth)
Defines the maximum nesting depth that the parser will descend before throwing an exception
when parsing the XML into JSONML.
|
public static final int UNDEFINED_MAXIMUM_NESTING_DEPTH
public static final int DEFAULT_MAXIMUM_NESTING_DEPTH
protected boolean keepStrings
true
), or if
they should try to be guessed into JSON values (numeric, boolean, string)protected int maxNestingDepth
public ParserConfiguration()
protected ParserConfiguration(boolean keepStrings, int maxNestingDepth)
keepStrings
- A boolean indicating whether to preserve strings during parsing.maxNestingDepth
- An integer representing the maximum allowed nesting depth.protected ParserConfiguration clone()
public boolean isKeepStrings()
true
), or if
they should try to be guessed into JSON values (numeric, boolean, string)keepStrings
configuration value.public <T extends ParserConfiguration> T withKeepStrings(boolean newVal)
true
), or if
they should try to be guessed into JSON values (numeric, boolean, string)T
- the type of the configuration objectnewVal
- new value to use for the keepStrings
configuration option.public int getMaxNestingDepth()
public <T extends ParserConfiguration> T withMaxNestingDepth(int maxNestingDepth)
T
- the type of the configuration objectmaxNestingDepth
- the maximum nesting depth allowed to the XML parserCopyright © 2024. All rights reserved.