public class JsonParserCharArray
extends BaseJsonParser
Converts an input JSON String into Java objects works with String or char array as input. Produces an Object which can be any of the basic JSON types mapped to Java.
| Modifiers | Name | Description |
|---|---|---|
protected static char[] |
FALSE |
Character buffer for the false literal. |
protected static char[] |
NULL |
Character buffer for the null literal. |
protected static char[] |
TRUE |
Character buffer for the true literal. |
protected char |
__currentChar |
Character at the current parser position. |
protected int |
__index |
Current position within charArray. |
protected char[] |
charArray |
Character buffer currently being parsed. |
| Fields inherited from class | Fields |
|---|---|
class BaseJsonParser |
ALPHA_0, ALPHA_1, ALPHA_2, ALPHA_3, ALPHA_4, ALPHA_5, ALPHA_6, ALPHA_7, ALPHA_8, ALPHA_9, CLOSED_BRACKET, CLOSED_CURLY, COLON, COMMA, DECIMAL_POINT, DOUBLE_QUOTE, ESCAPE, LETTER_BIG_E, LETTER_E, MINUS, PLUS, bufSize, charset, internKeys, internedKeysCache |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected final void |
complain(String complaint)Throws a JsonException for the current location. |
|
protected final char |
currentChar()Returns the current character in the input buffer. |
|
protected final boolean |
decodeFalse()Consumes the false literal. |
|
protected Object |
decodeFromChars(char[] cs)Initializes parser state and decodes a character buffer. |
|
protected final List |
decodeJsonArray()Decodes a JSON array from the current position. |
|
protected final Object |
decodeJsonObject()Decodes a JSON object from the current position. |
|
protected final Object |
decodeNull()Consumes the null literal. |
|
protected final boolean |
decodeTrue()Consumes the true literal. |
|
protected Object |
decodeValue()Decodes the next JSON value. |
|
protected String |
exceptionDetails(String message)Builds an error message using the current parser position. |
|
protected final boolean |
hasCurrent()Checks whether the current index is still within the buffer. |
|
protected final boolean |
hasMore()Checks whether more characters remain after the current index. |
|
protected final char |
nextChar()Advances to the next character in the input buffer. |
|
public Object |
parse(char[] chars)Parses JSON from a character array. |
|
protected final void |
skipWhiteSpace()Advances past JSON whitespace characters. |
| Methods inherited from class | Name |
|---|---|
class BaseJsonParser |
charDescription, findEndQuote, hasEscapeChar, isDecimalChar, isDelimiter, isDoubleQuote, isEscape, isNumberDigit, parse, parse, parse, parse, parse, parse, parse, parse, setCharset |
Character buffer for the false literal.
Character buffer for the null literal.
Character buffer for the true literal.
Character at the current parser position.
Current position within charArray.
Character buffer currently being parsed.
Throws a JsonException for the current location.
complaint - message describing the parse failureReturns the current character in the input buffer.
0 when the index is past the end Consumes the false literal.
falseInitializes parser state and decodes a character buffer.
cs - JSON content to parseDecodes a JSON array from the current position.
Decodes a JSON object from the current position.
Consumes the null literal.
null Consumes the true literal.
trueDecodes the next JSON value.
Builds an error message using the current parser position.
message - parser-specific messageChecks whether the current index is still within the buffer.
true when the current position is validChecks whether more characters remain after the current index.
true when another character can be consumedAdvances to the next character in the input buffer.
0 when the buffer is exhaustedParses JSON from a character array.
chars - JSON content to parseAdvances past JSON whitespace characters.