Package org.apache.groovy.json.internal

# Class JsonFastParser

java.lang.Object
org.apache.groovy.json.internal.BaseJsonParser
org.apache.groovy.json.internal.JsonParserCharArray
org.apache.groovy.json.internal.JsonFastParser

All Implemented Interfaces:
  `JsonParser`

public class JsonFastParser extends JsonParserCharArray
This works in index overlay mode or chop mode. Chop mode reduces possibility of memory leak but causes a few more buffer copies as it chops up the buffer.

- ## Field Summary

  ### Fields inherited from class org.apache.groovy.json.internal.JsonParserCharArray

  `__currentChar, __index, charArray, FALSE, NULL, TRUE`

  ### Fields inherited from class org.apache.groovy.json.internal.BaseJsonParser

  `ALPHA_0, ALPHA_1, ALPHA_2, ALPHA_3, ALPHA_4, ALPHA_5, ALPHA_6, ALPHA_7, ALPHA_8, ALPHA_9, bufSize, charset, CLOSED_BRACKET, CLOSED_CURLY, COLON, COMMA, DECIMAL_POINT, DEFAULT_MAX_NESTING_DEPTH, DOUBLE_QUOTE, ESCAPE, internedKeysCache, internKeys, LETTER_BIG_E, LETTER_E, maxNestingDepth, MINUS, PLUS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JsonFastParser()`
  Creates a parser with eager value containers and lazy chopping.
  `JsonFastParser(boolean useValues)`
  Creates a parser with the supplied value-container mode.
  `JsonFastParser(boolean useValues, boolean chop)`
  Creates a parser with explicit chopping behavior.
  `JsonFastParser(boolean useValues, boolean chop, boolean lazyChop)`
  Creates a parser with explicit lazy chopping behavior.
  `JsonFastParser(boolean useValues, boolean chop, boolean lazyChop, boolean checkDates)`
  Creates a parser with full overlay configuration.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected final Object`
  `decodeFromChars(char[] cs)`
  Parses a character buffer and unwraps top-level container values.
  `protected final Value`
  `decodeJsonObjectLazyFinalParse()`
  Decodes an object using overlay values and deferred materialization.
  `protected Value`
  `decodeValue()`
  Decodes the next JSON value as an overlay `Value`.

  ### Methods inherited from class org.apache.groovy.json.internal.JsonParserCharArray

  `complain, currentChar, decodeFalse, decodeJsonArray, decodeJsonObject, decodeNull, decodeTrue, exceptionDetails, hasCurrent, hasMore, nextChar, parse, skipWhiteSpace`

  ### Methods inherited from class org.apache.groovy.json.internal.BaseJsonParser

  `charDescription, enterNesting, exitNesting, findEndQuote, getMaxNestingDepth, hasEscapeChar, isDecimalChar, isDelimiter, isDoubleQuote, isEscape, isNumberDigit, parse, parse, parse, parse, parse, parse, parse, parse, resetNesting, setCharset, setMaxNestingDepth`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JsonFastParser

    public JsonFastParser()
    Creates a parser with eager value containers and lazy chopping.

  - ### JsonFastParser

    public JsonFastParser(boolean useValues)
    Creates a parser with the supplied value-container mode.
    Parameters:
      `useValues` - whether to use eager `Value` containers

  - ### JsonFastParser

    public JsonFastParser(boolean useValues, boolean chop)
    Creates a parser with explicit chopping behavior.
    Parameters:
      `useValues` - whether to use eager `Value` containers
      `chop` - whether to eagerly copy overlay slices

  - ### JsonFastParser

    public JsonFastParser(boolean useValues, boolean chop, boolean lazyChop)
    Creates a 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

  - ### JsonFastParser

    public JsonFastParser(boolean useValues, boolean chop, boolean lazyChop, boolean checkDates)
    Creates a 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
      `checkDates` - whether strings should be tested for supported date formats

- ## Method Details

  - ### decodeJsonObjectLazyFinalParse

    protected final Value decodeJsonObjectLazyFinalParse()
    Decodes an object using overlay values and deferred materialization.
    Returns:
      parsed object value container

  - ### decodeValue

    protected Value decodeValue()
    Decodes the next JSON value as an overlay `Value`.
    Overrides:
      `decodeValue` in class `JsonParserCharArray`
    Returns:
      parsed overlay value

  - ### decodeFromChars

    protected final Object decodeFromChars(char[] cs)
    Parses a character buffer and unwraps top-level container values.
    Overrides:
      `decodeFromChars` in class `JsonParserCharArray`
    Parameters:
      `cs` - JSON content to parse
    Returns:
      parsed Groovy JSON value