Package io.micronaut.serde.jackson
Class JacksonEncoder
java.lang.Object
io.micronaut.serde.LimitingStream
io.micronaut.serde.jackson.JacksonEncoder
- All Implemented Interfaces:
- Encoder,- AutoCloseable
Implementation of the 
Encoder interface for Jackson.- 
Nested Class SummaryNested classes/interfaces inherited from class io.micronaut.serde.LimitingStreamLimitingStream.RemainingLimits
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.core.JsonGeneratorFields inherited from class io.micronaut.serde.LimitingStreamDEFAULT_LIMITS, DEFAULT_MAXIMUM_DEPTH
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidclose()Finalize the current structure.static @NonNull Encodercreate(@NonNull com.fasterxml.jackson.core.JsonGenerator generator) static @NonNull Encodercreate(@NonNull com.fasterxml.jackson.core.JsonGenerator generator, @NonNull LimitingStream.RemainingLimits remainingLimits) Create a new encoder.Return an analysis of the current path.final EncoderencodeArray(io.micronaut.core.type.Argument<?> type) Encodes an array.final voidencodeBigDecimal(@NonNull BigDecimal value) Encode a BigDecimal.final voidencodeBigInteger(@NonNull BigInteger value) Encode a BigInteger.voidencodeBinary(byte @NonNull [] data) Encode the given binary data.final voidencodeBoolean(boolean value) Encode a boolean.final voidencodeByte(byte value) Encode a byte.final voidencodeChar(char value) Encode a char.final voidencodeDouble(double value) Encode a double.final voidencodeFloat(float value) Encode a float.final voidencodeInt(int value) Encode an int.final voidEncode a key.final voidencodeLong(long value) Encode a long.final voidEncodenull.final EncoderencodeObject(io.micronaut.core.type.Argument<?> type) Encodes an object.final voidencodeShort(short value) Encode a short.final voidencodeString(@NonNull String value) Encode a string.final voidFinalize a previously created structure, like an array or object.protected abstract voidMethods inherited from class io.micronaut.serde.LimitingStreamchildLimits, decreaseDepth, increaseDepth, limitsFromConfiguration, ourLimits
- 
Field Details- 
generatorprotected final com.fasterxml.jackson.core.JsonGenerator generator
 
- 
- 
Method Details- 
create@NonNull public static @NonNull Encoder create(@NonNull @NonNull com.fasterxml.jackson.core.JsonGenerator generator) 
- 
create@NonNull @Internal public static @NonNull Encoder create(@NonNull @NonNull com.fasterxml.jackson.core.JsonGenerator generator, @NonNull @NonNull LimitingStream.RemainingLimits remainingLimits) Create a new encoder.- Parameters:
- generator- The jackson-core generator to write to
- remainingLimits- The maximum nesting depth
- Returns:
- The encoder
 
- 
encodeArrayDescription copied from interface:EncoderEncodes an array.- Specified by:
- encodeArrayin interface- Encoder
- Parameters:
- type- The array type, never- null
- Returns:
- The encoder, never null
- Throws:
- IOException- if an error occurs
 
- 
encodeObjectDescription copied from interface:EncoderEncodes an object.- Specified by:
- encodeObjectin interface- Encoder
- Parameters:
- type- The object type, never- null
- Returns:
- The encoder, never null
- Throws:
- IOException- if an error occurs
 
- 
finishStructureDescription copied from interface:EncoderFinalize a previously created structure, like an array or object.- Specified by:
- finishStructurein interface- Encoder
- Throws:
- IOException- If an error occurs
 
- 
closeDescription copied from interface:EncoderFinalize the current structure. Equivalent to callingEncoder.finishStructure().- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Encoder
- Throws:
- IOException- If an unrecoverable error occurs
 
- 
finishStructureToken- Throws:
- IOException
 
- 
currentPathDescription copied from interface:EncoderReturn an analysis of the current path.- Specified by:
- currentPathin interface- Encoder
- Returns:
- The current path if known
 
- 
encodeKeyDescription copied from interface:EncoderEncode a key.- Specified by:
- encodeKeyin interface- Encoder
- Parameters:
- key- The key, never- null
- Throws:
- IOException- If an error occurs
 
- 
encodeStringDescription copied from interface:EncoderEncode a string.- Specified by:
- encodeStringin interface- Encoder
- Parameters:
- value- The string, never- null
- Throws:
- IOException- If an error occurs
 
- 
encodeBooleanDescription copied from interface:EncoderEncode a boolean.- Specified by:
- encodeBooleanin interface- Encoder
- Parameters:
- value- The boolean
- Throws:
- IOException- If an error occurs
 
- 
encodeByteDescription copied from interface:EncoderEncode a byte.- Specified by:
- encodeBytein interface- Encoder
- Parameters:
- value- The byte
- Throws:
- IOException- If an error occurs
 
- 
encodeShortDescription copied from interface:EncoderEncode a short.- Specified by:
- encodeShortin interface- Encoder
- Parameters:
- value- The short
- Throws:
- IOException- If an error occurs
 
- 
encodeCharDescription copied from interface:EncoderEncode a char.- Specified by:
- encodeCharin interface- Encoder
- Parameters:
- value- The char
- Throws:
- IOException- If an error occurs
 
- 
encodeIntDescription copied from interface:EncoderEncode an int.- Specified by:
- encodeIntin interface- Encoder
- Parameters:
- value- The int
- Throws:
- IOException- If an error occurs
 
- 
encodeLongDescription copied from interface:EncoderEncode a long.- Specified by:
- encodeLongin interface- Encoder
- Parameters:
- value- The long
- Throws:
- IOException- If an error occurs
 
- 
encodeFloatDescription copied from interface:EncoderEncode a float.- Specified by:
- encodeFloatin interface- Encoder
- Parameters:
- value- The float
- Throws:
- IOException- If an error occurs
 
- 
encodeDoubleDescription copied from interface:EncoderEncode a double.- Specified by:
- encodeDoublein interface- Encoder
- Parameters:
- value- The double
- Throws:
- IOException- If an error occurs
 
- 
encodeBigIntegerDescription copied from interface:EncoderEncode a BigInteger.- Specified by:
- encodeBigIntegerin interface- Encoder
- Parameters:
- value- The BigInteger, never- null
- Throws:
- IOException- If an error occurs
 
- 
encodeBigDecimalDescription copied from interface:EncoderEncode a BigDecimal.- Specified by:
- encodeBigDecimalin interface- Encoder
- Parameters:
- value- The BigDecimal, never- null
- Throws:
- IOException- If an error occurs
 
- 
encodeBinaryDescription copied from interface:EncoderEncode the given binary data. The shape of the data in the output is unspecified, the only requirement is that the equivalentDecoder.decodeBinary()must be able to parse to the same data.- Specified by:
- encodeBinaryin interface- Encoder
- Parameters:
- data- The input data
- Throws:
- IOException
 
- 
encodeNullDescription copied from interface:EncoderEncodenull.- Specified by:
- encodeNullin interface- Encoder
- Throws:
- IOException- If an error occurs
 
 
-