Package org.h2.util.json
Class JSONTextSource
- java.lang.Object
-
- org.h2.util.json.JSONTextSource
-
- Direct Known Subclasses:
JSONBytesSource,JSONStringSource
public abstract class JSONTextSource extends java.lang.ObjectJSON text source.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringBuilderbuilder(package private) JSONTarget<?>targetThe output.
-
Constructor Summary
Constructors Constructor Description JSONTextSource(JSONTarget<?> target)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private booleanappendChar(char ch, boolean inSurrogate)private voidappendNonSurrogate(char ch, boolean inSurrogate)(package private) abstract intnextChar()Read the next character.(package private) abstract intnextCharAfterWhitespace()Skip all whitespace characters, and get the next character.(package private) voidparse()Parse the text and write it to the output.(package private) abstract voidparseNumber(boolean positive)Parse a number.(package private) abstract charreadHex()Read 4 hex characters (0-9, a-f, A-F), and return the Unicode character.(package private) abstract voidreadKeyword1(java.lang.String keyword)Read the specified keyword, or (it there is no match), throw an IllegalArgumentException.private java.lang.StringreadString()
-
-
-
Field Detail
-
target
final JSONTarget<?> target
The output.
-
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)
-
-