java.lang.Integer ).
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | |
| public static class | NumberSerializers.
This is the special serializer for regular Since this is one of "native" types, no type information is ever included on serialization (unlike for most scalar types as of 1.5) |
| public static class | |
| public static class | NumberSerializers.
This is the special serializer for regular
Since this is one of "natural" types, no type information is ever included
on serialization (unlike for most scalar types, except for |
| public static class | NumberSerializers.
Similar to |
| public static class | |
| public static class |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void |
| NumberSerializers | back to summary |
|---|---|
| protected NumberSerializers() | |
| addAll | back to summary |
|---|---|
| public static void addAll(Map<String, ValueSerializer<?>> allDeserializers) | |
Note
while you can extend this class yourself it is not designed as an extension point, and as such is not part of public API. This means that the compatibility across minor versions is only guaranteed on minor-to-minor basis, and class methods may be changed and/or removed via deprecation mechanism. Intent is, however, to allow for gradual upgrading so that methods to remove are marked deprecated for at least one minor version.
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | |
| protected final JsonParser. | |
| protected final String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
Overrides tools. Implements tools. Default implementation specifies no format. |
| public ValueSerializer | createContextual(SerializationContext prov, BeanProperty property)
Overrides tools. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed). |
| _isInt | back to summary |
|---|---|
| protected final boolean _isInt | |
| _numberType | back to summary |
|---|---|
| protected final JsonParser. | |
| _schemaType | back to summary |
|---|---|
| protected final String _schemaType | |
| Base | back to summary |
|---|---|
| protected Base(Class<?> cls, JsonParser. | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) Overrides tools. Implements tools. Doc from tools. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| createContextual | back to summary |
|---|---|
| public ValueSerializer Overrides tools. Doc from tools. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed). Note that instance that this method is called on is typically shared one and as a result method should NOT modify this instance but rather construct and return a new instance. This instance should only be returned as-is, in case it is already suitable for use. Note that method is only called once per POJO property, and for the first usage as root value serializer; it is not called for every serialization, as doing that would have significant performance impact; most serializers cache contextual instances for future use.
| |
java.lang.Double s (and
primitive doubles)
Since this is one of "native" types, no type information is ever included on serialization (unlike for most scalar types as of 1.5)
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| public void | serializeWithType(Object value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer)
Overrides tools. 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. |
| DoubleSerializer | back to summary |
|---|---|
| public DoubleSerializer(Class<?> cls) | |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(Object value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException Overrides tools. Doc from tools. 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. This should work for most cases; some sub-classes may want to change this behavior.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final NumberSerializers. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| instance | back to summary |
|---|---|
| pack-priv static final NumberSerializers. | |
| FloatSerializer | back to summary |
|---|---|
| public FloatSerializer() | |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
java.lang.Integer s
(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).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| public void | serializeWithType(Object value, JsonGenerator gen, SerializationContext provider, TypeSerializer typeSer)
Overrides tools. 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. |
| IntegerSerializer | back to summary |
|---|---|
| public IntegerSerializer(Class<?> type) | |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(Object value, JsonGenerator gen, SerializationContext provider, TypeSerializer typeSer) throws JacksonException Overrides tools. Doc from tools. 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. This should work for most cases; some sub-classes may want to change this behavior.
| |
IntegerSerializer, but will not cast to Integer:
instead, cast is to java.lang.Number , and conversion is by
calling java.lang.Number#intValue .
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final NumberSerializers. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| instance | back to summary |
|---|---|
| pack-priv static final NumberSerializers. | |
| IntLikeSerializer | back to summary |
|---|---|
| public IntLikeSerializer() | |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| LongSerializer | back to summary |
|---|---|
| public LongSerializer(Class<?> cls) | |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final NumberSerializers. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| instance | back to summary |
|---|---|
| pack-priv static final NumberSerializers. | |
| ShortSerializer | back to summary |
|---|---|
| public ShortSerializer() | |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |