JsonParserSettings

besom.json.JsonParserSettings
See theJsonParserSettings companion object
sealed trait JsonParserSettings

Allows to customize settings for the JSON parser.

Use it like this:

val customSettings =
 JsonParserSettings.default
   .withMaxDepth(100)
   .withMaxNumberCharacters(20)

JsonParser(jsonString, customSettings)
// or
jsonString.parseJson(customSettings)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def maxDepth: Int

The JsonParser uses recursive decent parsing that keeps intermediate values on the stack. To prevent StackOverflowExceptions a limit is enforced on the depth of the parsed JSON structure.

The JsonParser uses recursive decent parsing that keeps intermediate values on the stack. To prevent StackOverflowExceptions a limit is enforced on the depth of the parsed JSON structure.

As a guideline we tested that one level of depth needs about 300 bytes of stack space.

The default is a depth of 1000.

Attributes

The maximum number of characters the parser should support for numbers. This is restricted because creating BigDecimals with high precision can be very slow (approx. quadratic runtime per amount of characters).

The maximum number of characters the parser should support for numbers. This is restricted because creating BigDecimals with high precision can be very slow (approx. quadratic runtime per amount of characters).

Attributes

Returns a copy of this settings object with the maxDepth setting changed to the new value.

Returns a copy of this settings object with the maxDepth setting changed to the new value.

Attributes

Returns a copy of this settings object with the maxNumberCharacters setting changed to the new value.

Returns a copy of this settings object with the maxNumberCharacters setting changed to the new value.

Attributes