Class JsonParserBase
java.lang.Object
io.helidon.json.JsonParserBase
- All Implemented Interfaces:
JsonParser
- Direct Known Subclasses:
SmileParser
Base implementation of
JsonParser.-
Field Summary
Fields inherited from interface JsonParser
MAX_NESTING_DEPTHModifier and TypeFieldDescriptionstatic final intMaximum number of nested JSON object and array structures supported by this parser. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected default constructor for subclasses. -
Method Summary
Modifier and TypeMethodDescriptionReads a JSON array from the current position.Reads a JSON object from the current position.Reads a complete JSON value from the current position.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JsonParser
checkNull, clearMark, createException, createException, createException, currentByte, hasNext, mark, nextToken, readBigDecimal, readBigInteger, readBinary, readBoolean, readByte, readChar, readDouble, readFloat, readInt, readJsonNumber, readJsonString, readLong, readShort, readString, readStringAsHash, resetToMark, skipModifier and TypeMethodDescriptionbooleanChecks if the current position contains a null value.voidClears the current mark.createException(String message) Create a JsonException with the given message.default JsonExceptioncreateException(String message, byte c) Create a JsonException with the given message and found byte information.createException(String message, Exception e) Create a JsonException with the given message and cause.byteReturn the last byte that was read from the stream.booleanhasNext()Checks if there are more tokens available in the JSON stream.voidmark()Marks the current position in the JSON.byteReads the next JSON token without consuming it.Reads a numeric value asBigDecimal.Reads a numeric value asBigInteger.byte[]Reads a binary value.booleanReads a boolean value from the current position.bytereadByte()Reads a numeric value as a byte.charreadChar()Reads a char value from the current position.doubleReads a numeric value as a double.floatReads a numeric value as a float.intreadInt()Reads a numeric value as an int.Reads a JSON number value from the current position.Reads a JSON string value from the current position.longreadLong()Reads a numeric value as a long.shortReads a numeric value as a short.Reads a string value from the current position.intReads a string value and returns its FNV-1a hash.voidResets the parser position to the previously marked position.voidskip()Skips the current JSON value without parsing it.
-
Constructor Details
-
JsonParserBase
protected JsonParserBase()Protected default constructor for subclasses.
-
-
Method Details
-
readJsonValue
Description copied from interface:JsonParserReads a complete JSON value from the current position.This method parses and returns the next complete JSON value (object, array, string, number, boolean, or null) from the current parser position.
- Specified by:
readJsonValuein interfaceJsonParser- Returns:
- the parsed JsonValue
- See Also:
-
readJsonObject
Description copied from interface:JsonParserReads a JSON object from the current position.This method expects the next token to be an object start ('{') and parses the complete object including all nested values.
- Specified by:
readJsonObjectin interfaceJsonParser- Returns:
- the parsed JsonObject
- See Also:
-
readJsonArray
Description copied from interface:JsonParserReads a JSON array from the current position.This method expects the next token to be an array start ('[') and parses the complete array including all nested values.
- Specified by:
readJsonArrayin interfaceJsonParser- Returns:
- the parsed JsonArray
- See Also:
-