Package: org.apache.groovy.json.internal

## [Java] Class JsonParserUsingCharacterSource

- org.apache.groovy.json.internal.JsonParserUsingCharacterSource

-     public class JsonParserUsingCharacterSource
      extends BaseJsonParser

  Converts an input JSON String into Java objects works with String or char array as input. Produces an Object which can be any of the basic JSON types mapped to Java.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected static char[]` | `FALSE` | Character buffer for the `false` literal.
    `protected static char[]` | `NULL` | Character buffer for the `null` literal.
    `protected static char[]` | `TRUE` | Character buffer for the `true` literal.

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `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, DOUBLE_QUOTE, ESCAPE, LETTER_BIG_E, LETTER_E, MINUS, PLUS, bufSize, charset, internKeys, internedKeysCache`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected final void` | `complain(String complaint)` Throws a JsonException for the current source location.
    `` | `protected final boolean` | `decodeFalse()` Consumes the `false` literal.
    `` | `protected final List` | `decodeJsonArray()` Decodes a JSON array from the current character source position.
    `` | `protected final Object` | `decodeJsonObject()` Decodes a JSON object from the current character source position.
    `` | `protected final Object` | `decodeNull()` Consumes the `null` literal.
    `` | `protected final boolean` | `decodeTrue()` Consumes the `true` literal.
    `` | `protected String` | `exceptionDetails(String message)` Builds an error message using the current character source state.
    `` | `public Object` | `parse(Reader reader)` Parses JSON from a reader-backed character source.
    `` | `public Object` | `parse(char[] chars)` Parses JSON from a character array.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BaseJsonParser` | `charDescription, findEndQuote, hasEscapeChar, isDecimalChar, isDelimiter, isDoubleQuote, isEscape, isNumberDigit, parse, parse, parse, parse, parse, parse, parse, parse, setCharset`

- - ### Field Detail

    - #### protected static char[] FALSE

      Character buffer for the `false` literal.

    - #### protected static final char[] NULL

      Character buffer for the `null` literal.

    - #### protected static final char[] TRUE

      Character buffer for the `true` literal.

  - ### Method Detail

    - #### protected final void complain(String complaint)

      Throws a JsonException for the current source location.

      Parameters:
        `complaint` - message describing the parse failure

    - #### protected final boolean decodeFalse()

      Consumes the `false` literal.

      Returns:
        `false`

    - #### protected final List decodeJsonArray()

      Decodes a JSON array from the current character source position.

      Returns:
        parsed array contents

    - #### protected final Object decodeJsonObject()

      Decodes a JSON object from the current character source position.

      Returns:
        parsed object as a LazyMap

    - #### protected final Object decodeNull()

      Consumes the `null` literal.

      Returns:
        `null`

    - #### protected final boolean decodeTrue()

      Consumes the `true` literal.

      Returns:
        `true`

    - #### protected String exceptionDetails(String message)

      Builds an error message using the current character source state.

      Parameters:
        `message` - parser-specific message
      Returns:
        formatted error details

    - #### public Object parse(Reader reader)

      Parses JSON from a reader-backed character source.

      Parameters:
        `reader` - reader supplying JSON content
      Returns:
        parsed Groovy JSON value

    - #### public Object parse(char[] chars)

      Parses JSON from a character array.

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