Package org.h2.util.json
Class JSONTextSource
java.lang.Object
org.h2.util.json.JSONTextSource
- Direct Known Subclasses:
JSONBytesSource,JSONStringSource
JSON text source.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringBuilder(package private) final JSONTarget<?> The output. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanappendChar(char ch, boolean inSurrogate) private voidappendNonSurrogate(char ch, boolean inSurrogate) (package private) abstract intnextChar()Read the next character.(package private) abstract intSkip all whitespace characters, and get the next character.(package private) final 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(String keyword) Read the specified keyword, or (it there is no match), throw an IllegalArgumentException.private String
-
Field Details
-
target
The output. -
builder
-
-
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
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
-
appendNonSurrogate
private void appendNonSurrogate(char ch, boolean inSurrogate) -
appendChar
private boolean appendChar(char ch, boolean inSurrogate)
-