Class JSONTextSource

java.lang.Object
org.h2.util.json.JSONTextSource
Direct Known Subclasses:
JSONBytesSource, JSONStringSource

public abstract class JSONTextSource extends Object
JSON text source.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final StringBuilder
     
    (package private) final JSONTarget<?>
    The output.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private boolean
    appendChar(char ch, boolean inSurrogate)
     
    private void
    appendNonSurrogate(char ch, boolean inSurrogate)
     
    (package private) abstract int
    Read the next character.
    (package private) abstract int
    Skip all whitespace characters, and get the next character.
    (package private) final void
    Parse the text and write it to the output.
    (package private) abstract void
    parseNumber(boolean positive)
    Parse a number.
    (package private) abstract char
    Read 4 hex characters (0-9, a-f, A-F), and return the Unicode character.
    (package private) abstract void
    Read the specified keyword, or (it there is no match), throw an IllegalArgumentException.
    private String
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • JSONTextSource

      JSONTextSource(JSONTarget<?> target)
  • Method Details

    • parse

      final void parse()
      Parse the text and write it to the output.
    • nextCharAfterWhitespace

      abstract int nextCharAfterWhitespace()
      Skip all whitespace characters, and get the next character.
      Returns:
      the character code
    • readKeyword1

      abstract void readKeyword1(String keyword)
      Read the specified keyword, or (it there is no match), throw an IllegalArgumentException.
      Parameters:
      keyword - the expected keyword
    • parseNumber

      abstract void parseNumber(boolean positive)
      Parse a number.
      Parameters:
      positive - whether it needs to be positive
    • nextChar

      abstract int nextChar()
      Read the next character.
      Returns:
      the character code
    • readHex

      abstract char readHex()
      Read 4 hex characters (0-9, a-f, A-F), and return the Unicode character.
      Returns:
      the character
    • readString

      private String readString()
    • appendNonSurrogate

      private void appendNonSurrogate(char ch, boolean inSurrogate)
    • appendChar

      private boolean appendChar(char ch, boolean inSurrogate)