Modifier and Type | Method and Description |
---|---|
static JsonNodeDecoder |
create(io.micronaut.json.tree.JsonNode node) |
java.io.IOException |
createDeserializationException(java.lang.String message,
java.lang.Object invalidValue)
Creates an exception for the given message.
|
java.lang.Object |
decodeArbitrary()
Decodes the current state into an arbitrary object.
|
Decoder |
decodeArray(io.micronaut.core.type.Argument<?> type)
Start decoding an array.
|
java.math.BigDecimal |
decodeBigDecimal()
Decodes a BigDecimal.
|
java.math.BigInteger |
decodeBigInteger()
Decodes a BigInteger.
|
boolean |
decodeBoolean()
Decodes a boolean.
|
Decoder |
decodeBuffer()
Buffer the whole subtree of this value and return it as a new
Decoder . |
byte |
decodeByte()
Decodes a byte.
|
char |
decodeChar()
Decodes a char.
|
double |
decodeDouble()
Decodes a double.
|
float |
decodeFloat()
Decodes a float.
|
int |
decodeInt()
Decodes a int.
|
long |
decodeLong()
Decodes a long.
|
boolean |
decodeNull()
Attempt to decode a null value.
|
Decoder |
decodeObject(io.micronaut.core.type.Argument<?> type)
Decodes an object.
|
short |
decodeShort()
Decodes a short.
|
java.lang.String |
decodeString()
Decodes a string.
|
protected abstract io.micronaut.json.tree.JsonNode |
peekValue() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, decodeArray, decodeKey, decodeObject, finishStructure, hasNextArrayValue, skipValue
public static JsonNodeDecoder create(io.micronaut.json.tree.JsonNode node)
protected abstract io.micronaut.json.tree.JsonNode peekValue()
public Decoder decodeArray(io.micronaut.core.type.Argument<?> type) throws java.io.IOException
Decoder
decodeArray
in interface Decoder
type
- The array typejava.io.IOException
- If an unrecoverable error occurspublic Decoder decodeObject(io.micronaut.core.type.Argument<?> type) throws java.io.IOException
Decoder
decodeObject
in interface Decoder
type
- The type, never null
java.io.IOException
- If an unrecoverable error occurspublic java.lang.String decodeString() throws java.io.IOException
Decoder
decodeString
in interface Decoder
null
java.io.IOException
- If an unrecoverable error occurspublic boolean decodeBoolean() throws java.io.IOException
Decoder
decodeBoolean
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic byte decodeByte() throws java.io.IOException
Decoder
decodeByte
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic short decodeShort() throws java.io.IOException
Decoder
decodeShort
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic char decodeChar() throws java.io.IOException
Decoder
decodeChar
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic int decodeInt() throws java.io.IOException
Decoder
public long decodeLong() throws java.io.IOException
Decoder
decodeLong
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic float decodeFloat() throws java.io.IOException
Decoder
decodeFloat
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic double decodeDouble() throws java.io.IOException
Decoder
decodeDouble
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic java.math.BigInteger decodeBigInteger() throws java.io.IOException
Decoder
decodeBigInteger
in interface Decoder
null
java.io.IOException
- If an unrecoverable error occurspublic java.math.BigDecimal decodeBigDecimal() throws java.io.IOException
Decoder
decodeBigDecimal
in interface Decoder
null
java.io.IOException
- If an unrecoverable error occurspublic boolean decodeNull() throws java.io.IOException
Decoder
false
if this value is not null, and another method should be
used for decoding. Returns true
if this value was null, and the cursor has been advanced to the next
value.decodeNull
in interface Decoder
true
if the value was null
java.io.IOException
- If an unrecoverable error occurspublic java.lang.Object decodeArbitrary() throws java.io.IOException
Decoder
The following should be decoded by this method:
Map
List
decodeArbitrary
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic Decoder decodeBuffer() throws java.io.IOException
Decoder
Decoder
. The returned Decoder
can
be used independently to this Decoder
. This means actual parsing of the subtree can be delayed.
The returned Decoder
should behave identically to this Decoder
. This means that for example
decoder.decodeDouble()
should be equivalent to decoder.decodeBuffer().decodeDouble()
.
decodeBuffer
in interface Decoder
java.io.IOException
- If an unrecoverable error occurspublic java.io.IOException createDeserializationException(java.lang.String message, java.lang.Object invalidValue)
Decoder
createDeserializationException
in interface Decoder
message
- The message, never null
invalidValue
- The invalid value. Can be null
.null