-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding JSONParserConfiguration for configuring the depth of nested maps
- Loading branch information
1 parent
dcac3bc
commit abea194
Showing
5 changed files
with
115 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.json; | ||
|
||
/** | ||
* Configuration object for the JSON parser. The configuration is immutable. | ||
*/ | ||
public class JSONParserConfiguration extends ParserConfiguration { | ||
|
||
/** | ||
* We can override the default maximum nesting depth if needed. | ||
*/ | ||
public static final int DEFAULT_MAXIMUM_NESTING_DEPTH = ParserConfiguration.DEFAULT_MAXIMUM_NESTING_DEPTH; | ||
|
||
/** | ||
* Configuration with the default values. | ||
*/ | ||
public JSONParserConfiguration() { | ||
this.maxNestingDepth = DEFAULT_MAXIMUM_NESTING_DEPTH; | ||
} | ||
|
||
public JSONParserConfiguration(int maxNestingDepth) { | ||
this.maxNestingDepth = maxNestingDepth; | ||
} | ||
|
||
@Override | ||
protected JSONParserConfiguration clone() { | ||
return new JSONParserConfiguration(DEFAULT_MAXIMUM_NESTING_DEPTH); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters