public interface Encoder
extends java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
default void |
close()
Finalize the current structure.
|
default java.lang.String |
currentPath()
Return an analysis of the current path.
|
Encoder |
encodeArray(io.micronaut.core.type.Argument<?> type)
Encodes an array.
|
void |
encodeBigDecimal(java.math.BigDecimal value)
Encode a BigDecimal.
|
void |
encodeBigInteger(java.math.BigInteger value)
Encode a BigInteger.
|
void |
encodeBoolean(boolean value)
Encode a boolean.
|
void |
encodeByte(byte value)
Encode a byte.
|
void |
encodeChar(char value)
Encode a char.
|
void |
encodeDouble(double value)
Encode a double.
|
void |
encodeFloat(float value)
Encode a float.
|
void |
encodeInt(int value)
Encode an int.
|
void |
encodeKey(java.lang.String key)
Encode a key.
|
void |
encodeLong(long value)
Encode a long.
|
void |
encodeNull()
Encode
null . |
Encoder |
encodeObject(io.micronaut.core.type.Argument<?> type)
Encodes an object.
|
void |
encodeShort(short value)
Encode a short.
|
void |
encodeString(java.lang.String value)
Encode a string.
|
void |
finishStructure()
Finalize a previously created structure, like an array or object.
|
@NonNull Encoder encodeArray(@NonNull io.micronaut.core.type.Argument<?> type) throws java.io.IOException
type
- The array type, never null
null
java.io.IOException
- if an error occurs@NonNull Encoder encodeObject(@NonNull io.micronaut.core.type.Argument<?> type) throws java.io.IOException
type
- The object type, never null
null
java.io.IOException
- if an error occursvoid finishStructure() throws java.io.IOException
java.io.IOException
- If an error occursdefault void close() throws java.io.IOException
finishStructure()
.close
in interface java.lang.AutoCloseable
java.io.IOException
- If an unrecoverable error occursvoid encodeKey(@NonNull java.lang.String key) throws java.io.IOException
key
- The key, never null
java.io.IOException
- If an error occursvoid encodeString(@NonNull java.lang.String value) throws java.io.IOException
value
- The string, never null
java.io.IOException
- If an error occursvoid encodeBoolean(boolean value) throws java.io.IOException
value
- The booleanjava.io.IOException
- If an error occursvoid encodeByte(byte value) throws java.io.IOException
value
- The bytejava.io.IOException
- If an error occursvoid encodeShort(short value) throws java.io.IOException
value
- The shortjava.io.IOException
- If an error occursvoid encodeChar(char value) throws java.io.IOException
value
- The charjava.io.IOException
- If an error occursvoid encodeInt(int value) throws java.io.IOException
value
- The intjava.io.IOException
- If an error occursvoid encodeLong(long value) throws java.io.IOException
value
- The longjava.io.IOException
- If an error occursvoid encodeFloat(float value) throws java.io.IOException
value
- The floatjava.io.IOException
- If an error occursvoid encodeDouble(double value) throws java.io.IOException
value
- The doublejava.io.IOException
- If an error occursvoid encodeBigInteger(@NonNull java.math.BigInteger value) throws java.io.IOException
value
- The BigInteger, never null
java.io.IOException
- If an error occursvoid encodeBigDecimal(@NonNull java.math.BigDecimal value) throws java.io.IOException
value
- The BigDecimal, never null
java.io.IOException
- If an error occursvoid encodeNull() throws java.io.IOException
null
.java.io.IOException
- If an error occurs@NonNull default java.lang.String currentPath()