Class JSONTextSource

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.StringBuilder builder  
      (package private) JSONTarget<?> target
      The output.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean appendChar​(char ch, boolean inSurrogate)  
      private void appendNonSurrogate​(char ch, boolean inSurrogate)  
      (package private) abstract int nextChar()
      Read the next character.
      (package private) abstract int nextCharAfterWhitespace()
      Skip all whitespace characters, and get the next character.
      (package private) void parse()
      Parse the text and write it to the output.
      (package private) abstract void parseNumber​(boolean positive)
      Parse a number.
      (package private) abstract char readHex()
      Read 4 hex characters (0-9, a-f, A-F), and return the Unicode character.
      (package private) abstract void readKeyword1​(java.lang.String keyword)
      Read the specified keyword, or (it there is no match), throw an IllegalArgumentException.
      private java.lang.String readString()  
      • Methods inherited from class java.lang.Object

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

      • builder

        private final java.lang.StringBuilder builder
    • Constructor Detail

      • JSONTextSource

        JSONTextSource​(JSONTarget<?> target)
    • Method Detail

      • 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​(java.lang.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 java.lang.String readString()
      • appendNonSurrogate

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

        private boolean appendChar​(char ch,
                                   boolean inSurrogate)