public class JsonParserDecoder extends AbstractStreamDecoder
Decoder
interface for JSON-P.AbstractStreamDecoder.TokenType, AbstractStreamDecoder.ValueDecoder<R>
Constructor and Description |
---|
JsonParserDecoder(jakarta.json.stream.JsonParser jsonParser) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
coerceScalarToString()
Decode any non-null scalar value (number, string or boolean) to its string representation.
|
protected AbstractStreamDecoder |
createChildDecoder()
Create a new child decoder using
AbstractStreamDecoder(AbstractStreamDecoder) . |
java.io.IOException |
createDeserializationException(java.lang.String message,
java.lang.Object invalidValue)
Creates an exception for the given message.
|
protected AbstractStreamDecoder.TokenType |
currentToken() |
protected java.lang.Number |
getBestNumber()
Decode the current
AbstractStreamDecoder.TokenType.NUMBER value as a Number value. |
protected java.math.BigDecimal |
getBigDecimal()
Decode the current
AbstractStreamDecoder.TokenType.NUMBER value as a BigDecimal value. |
protected java.math.BigInteger |
getBigInteger()
Decode the current
AbstractStreamDecoder.TokenType.NUMBER value as a BigInteger value. |
protected boolean |
getBoolean()
Decode the current
AbstractStreamDecoder.TokenType.BOOLEAN value. |
protected java.lang.String |
getCurrentKey()
Get the current object field name.
|
protected double |
getDouble()
Decode the current
AbstractStreamDecoder.TokenType.NUMBER value as a double value. |
protected long |
getLong()
Decode the current
AbstractStreamDecoder.TokenType.NUMBER value as a long value. |
protected void |
nextToken()
Move to the next token.
|
protected void |
skipChildren()
If we are at a
AbstractStreamDecoder.TokenType.START_OBJECT or AbstractStreamDecoder.TokenType.START_ARRAY , skip to the matching
AbstractStreamDecoder.TokenType.END_OBJECT or AbstractStreamDecoder.TokenType.END_ARRAY . |
backFromChild, decodeArbitrary, decodeArray, decodeBigDecimal, decodeBigInteger, decodeBoolean, decodeBuffer, decodeByte, decodeChar, decodeCustom, decodeCustom, decodeDouble, decodeFloat, decodeInt, decodeKey, decodeLong, decodeNull, decodeNumber, decodeObject, decodeShort, decodeString, finishStructure, getBestNumberNode, getInteger, hasNextArrayValue, skipValue, unexpectedToken
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, decodeArray, decodeObject
public JsonParserDecoder(jakarta.json.stream.JsonParser jsonParser)
protected AbstractStreamDecoder.TokenType currentToken()
currentToken
in class AbstractStreamDecoder
protected void nextToken()
AbstractStreamDecoder
nextToken
in class AbstractStreamDecoder
protected java.lang.String getCurrentKey()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.KEY
.getCurrentKey
in class AbstractStreamDecoder
protected java.lang.String coerceScalarToString()
AbstractStreamDecoder
coerceScalarToString
in class AbstractStreamDecoder
protected AbstractStreamDecoder createChildDecoder()
AbstractStreamDecoder
AbstractStreamDecoder(AbstractStreamDecoder)
.createChildDecoder
in class AbstractStreamDecoder
protected boolean getBoolean()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.BOOLEAN
value. Called for no other token type.getBoolean
in class AbstractStreamDecoder
protected long getLong()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.NUMBER
value as a long value. Called for no other token type.getLong
in class AbstractStreamDecoder
protected double getDouble()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.NUMBER
value as a double value. Called for no other token type.getDouble
in class AbstractStreamDecoder
protected java.math.BigInteger getBigInteger()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.NUMBER
value as a BigInteger
value. Called for no other token type.getBigInteger
in class AbstractStreamDecoder
protected java.math.BigDecimal getBigDecimal()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.NUMBER
value as a BigDecimal
value. Called for no other token type.getBigDecimal
in class AbstractStreamDecoder
protected java.lang.Number getBestNumber()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.NUMBER
value as a Number
value. Called for no other token type.getBestNumber
in class AbstractStreamDecoder
protected void skipChildren()
AbstractStreamDecoder
AbstractStreamDecoder.TokenType.START_OBJECT
or AbstractStreamDecoder.TokenType.START_ARRAY
, skip to the matching
AbstractStreamDecoder.TokenType.END_OBJECT
or AbstractStreamDecoder.TokenType.END_ARRAY
. Else, do nothing.skipChildren
in class AbstractStreamDecoder
public java.io.IOException createDeserializationException(java.lang.String message, java.lang.Object invalidValue)
Decoder
message
- The message, never null
invalidValue
- The invalid value. Can be null
.null