Class ParserConfiguration
java.lang.Object
org.apache.sling.commons.json.util.ParserConfiguration
Deprecated.
Configuration base object for parsers. The configuration is immutable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Deprecated.The default maximum nesting depth when parsing a document.protected boolean
Deprecated.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
Deprecated.The 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
ConstructorsModifierConstructorDescriptionDeprecated.Constructs a new ParserConfiguration with default settings.protected
ParserConfiguration
(boolean keepStrings, int maxNestingDepth) Deprecated.Constructs a new ParserConfiguration with the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionprotected ParserConfiguration
clone()
Deprecated.Provides a new instance of the same configuration.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>
TwithKeepStrings
(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>
TwithMaxNestingDepth
(int maxNestingDepth) Deprecated.Defines the maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSONML.
-
Field Details
-
UNDEFINED_MAXIMUM_NESTING_DEPTH
public static final int UNDEFINED_MAXIMUM_NESTING_DEPTHDeprecated.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_DEPTHDeprecated.The default maximum nesting depth when parsing a document.- See Also:
-
keepStrings
protected boolean keepStringsDeprecated.Specifies if values should be kept as strings (true
), or if they should try to be guessed into JSON values (numeric, boolean, string) -
maxNestingDepth
protected int maxNestingDepthDeprecated.The maximum nesting depth when parsing a document.
-
-
Constructor Details
-
ParserConfiguration
public ParserConfiguration()Deprecated.Constructs a new ParserConfiguration with default settings. -
ParserConfiguration
protected ParserConfiguration(boolean keepStrings, int maxNestingDepth) Deprecated.Constructs a new ParserConfiguration with the specified settings.- Parameters:
keepStrings
- A boolean indicating whether to preserve strings during parsing.maxNestingDepth
- An integer representing the maximum allowed nesting depth.
-
-
Method Details
-
clone
Deprecated.Provides a new instance of the same configuration. -
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
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)- Type Parameters:
T
- the type of the configuration object- Parameters:
newVal
- new value to use for thekeepStrings
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
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.- Type Parameters:
T
- the type of the configuration object- Parameters:
maxNestingDepth
- the maximum nesting depth allowed to the XML parser- Returns:
- The existing configuration will not be modified. A new configuration is returned.
-