Module tools.jackson.databind
Package tools.jackson.databind.ser.jdk
Class NumberSerializers.IntegerSerializer
java.lang.Object
tools.jackson.databind.ValueSerializer<T>
tools.jackson.databind.ser.std.StdSerializer<T>
tools.jackson.databind.ser.std.StdScalarSerializer<T>
tools.jackson.databind.ser.jdk.NumberSerializers.Base<Object>
tools.jackson.databind.ser.jdk.NumberSerializers.IntegerSerializer
- All Implemented Interfaces:
JsonFormatVisitable
- Enclosing class:
- NumberSerializers
This is the special serializer for regular
Integers
(and primitive ints)
Since this is one of "natural" types, no type information is ever included
on serialization (unlike for most scalar types, except for double).
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueSerializer
ValueSerializer.None -
Field Summary
Fields inherited from class tools.jackson.databind.ser.jdk.NumberSerializers.Base
_isInt, _numberType, _schemaTypeFields inherited from class tools.jackson.databind.ser.std.StdSerializer
_handledType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidserialize(Object value, JsonGenerator gen, SerializationContext provider) Method that can be called to ask implementation to serialize values of type this serializer handles.voidserializeWithType(Object value, JsonGenerator gen, SerializationContext provider, TypeSerializer typeSer) Default implementation will write type prefix, call regular serialization method (since assumption is that value itself does not need JSON Array or Object start/end markers), and then write type suffix.Methods inherited from class tools.jackson.databind.ser.jdk.NumberSerializers.Base
acceptJsonFormatVisitor, createContextualMethods inherited from class tools.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, _wrapIOFailure, acceptJsonFormatVisitorForBinary, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrowMethods inherited from class tools.jackson.databind.ValueSerializer
getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, resolve, unwrappingSerializer, usesObjectId, withFilterId, withFormatOverrides, withIgnoredProperties
-
Constructor Details
-
IntegerSerializer
-
-
Method Details
-
serialize
public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Description copied from class:ValueSerializerMethod that can be called to ask implementation to serialize values of type this serializer handles.- Specified by:
serializein classStdSerializer<Object>- Parameters:
value- Value to serialize; can not be null.gen- Generator used to output resulting Json contentprovider- Context that can be used to get serializers for serializing Objects value contains, if any.- Throws:
JacksonException
-
serializeWithType
public void serializeWithType(Object value, JsonGenerator gen, SerializationContext provider, TypeSerializer typeSer) throws JacksonException Description copied from class:StdScalarSerializerDefault implementation will write type prefix, call regular serialization method (since assumption is that value itself does not need JSON Array or Object start/end markers), and then write type suffix. This should work for most cases; some sub-classes may want to change this behavior.- Overrides:
serializeWithTypein classStdScalarSerializer<Object>- Parameters:
value- Value to serialize; can not be null.gen- Generator used to output resulting Json contentprovider- Context that can be used to get serializers for serializing Objects value contains, if any.typeSer- Type serializer to use for including type information- Throws:
JacksonException
-