Package: org.apache.groovy.json.internal

## [Java] Class JsonParserLax

- org.apache.groovy.json.internal.JsonParserLax

-     public class JsonParserLax
      extends JsonParserCharArray

  JSON parser variant that also accepts comments, single quotes, and unquoted strings.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class JsonParserCharArray` | `FALSE, NULL, TRUE, __currentChar, __index, charArray`
    `class BaseJsonParser` | `ALPHA_0, ALPHA_1, ALPHA_2, ALPHA_3, ALPHA_4, ALPHA_5, ALPHA_6, ALPHA_7, ALPHA_8, ALPHA_9, CLOSED_BRACKET, CLOSED_CURLY, COLON, COMMA, DECIMAL_POINT, DEFAULT_MAX_NESTING_DEPTH, DEFAULT_MAX_NUMBER_LENGTH, DOUBLE_QUOTE, ESCAPE, LETTER_BIG_E, LETTER_E, MINUS, PLUS, bufSize, charset, internKeys, internedKeysCache, maxNestingDepth, maxNumberLength`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `JsonParserLax()` Creates a lax parser with eager value containers and lazy chopping.
    `JsonParserLax(boolean useValues)` Creates a lax parser with the supplied value-container mode.
    `JsonParserLax(boolean useValues, boolean chop)` Creates a lax parser with explicit chopping behavior.
    `JsonParserLax(boolean useValues, boolean chop, boolean lazyChop)` Creates a lax parser with explicit lazy chopping behavior.
    `JsonParserLax(boolean useValues, boolean chop, boolean lazyChop, JsonDateHandling defaultDateHandling)` Creates a lax parser with full overlay configuration.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected final Object` | `decodeFromChars(char[] cs)` Parses a character buffer and unwraps top-level container values.
    `` | `protected final Value` | `decodeNumberLax(boolean minus)` Decodes a number from a JSON value.
    `` | `protected final Object` | `decodeValue()` Decodes the next value using the parser's lax JSON rules.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class JsonParserCharArray` | `complain, currentChar, decodeFalse, decodeFromChars, decodeJsonArray, decodeJsonObject, decodeNull, decodeTrue, decodeValue, exceptionDetails, hasCurrent, hasMore, nextChar, parse, skipWhiteSpace`
    `class BaseJsonParser` | `charDescription, checkNumberLength, enterNesting, exitNesting, findEndQuote, getMaxNestingDepth, getMaxNumberLength, hasEscapeChar, isDecimalChar, isDelimiter, isDoubleQuote, isEscape, isNumberDigit, parse, parse, parse, parse, parse, parse, parse, parse, resetNesting, setCharset, setMaxNestingDepth, setMaxNumberLength`

- - ### Constructor Detail

    - #### public JsonParserLax()

      Creates a lax parser with eager value containers and lazy chopping.

    - #### public JsonParserLax(boolean useValues)

      Creates a lax parser with the supplied value-container mode.

      Parameters:
        `useValues` - whether to use eager Value containers

    - #### public JsonParserLax(boolean useValues, boolean chop)

      Creates a lax parser with explicit chopping behavior.

      Parameters:
        `useValues` - whether to use eager Value containers
        `chop` - whether to eagerly copy overlay slices

    - #### public JsonParserLax(boolean useValues, boolean chop, boolean lazyChop)

      Creates a lax parser with explicit lazy chopping behavior.

      Parameters:
        `useValues` - whether to use eager Value containers
        `chop` - whether to eagerly copy overlay slices
        `lazyChop` - whether to defer chopping until values are accessed

    - #### public JsonParserLax(boolean useValues, boolean chop, boolean lazyChop, JsonDateHandling defaultDateHandling)

      Creates a lax parser with full overlay configuration.

      Parameters:
        `useValues` - whether to use eager Value containers
        `chop` - whether to eagerly copy overlay slices
        `lazyChop` - whether to defer chopping until values are accessed
        `defaultDateHandling` - what a date-like string should become

  - ### Method Detail

    - #### protected final Object decodeFromChars(char[] cs)

      Parses a character buffer and unwraps top-level container values.

      Parameters:
        `cs` - JSON content to parse
      Returns:
        parsed Groovy JSON value

    - #### protected final Value decodeNumberLax(boolean minus)

      Decodes a number from a JSON value. If at any point it is determined that the value is not a valid number the value is treated as a `String`.

      Parameters:
        `minus` - indicate whether the number is negative
      Returns:
        a number, or `String` if not a valid number

    - #### protected final Object decodeValue()

      Decodes the next value using the parser's lax JSON rules.

      Returns:
        parsed Groovy JSON value or overlay value