java.lang.Object
tools.jackson.databind.ValueSerializer<T>
tools.jackson.databind.ser.std.StdSerializer<Object>
tools.jackson.databind.ser.jdk.JDKStringLikeSerializer
- All Implemented Interfaces:
JsonFormatVisitable
"Combo" serializer used for JDK types that work almost like
ToStringSerializer.- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueSerializer
ValueSerializer.None -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intFields inherited from class tools.jackson.databind.ser.std.StdSerializer
_handledType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) Default implementation specifies no format.static final ValueSerializer<?>booleanisEmpty(SerializationContext prov, Object value) Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).voidserialize(Object value, JsonGenerator g, SerializationContext provider) Method that can be called to ask implementation to serialize values of type this serializer handles.voidserializeWithType(Object value, JsonGenerator g, SerializationContext ctxt, 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.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
createContextual, getDelegatee, isUnwrappingSerializer, properties, replaceDelegatee, resolve, unwrappingSerializer, usesObjectId, withFilterId, withFormatOverrides, withIgnoredProperties
-
Field Details
-
TYPE_URL
protected static final int TYPE_URL- See Also:
-
TYPE_URI
protected static final int TYPE_URI- See Also:
-
TYPE_FILE
protected static final int TYPE_FILE- See Also:
-
TYPE_PATH
protected static final int TYPE_PATH- See Also:
-
TYPE_CLASS
protected static final int TYPE_CLASS- See Also:
-
TYPE_CURRENCY
protected static final int TYPE_CURRENCY- See Also:
-
TYPE_LOCALE
protected static final int TYPE_LOCALE- See Also:
-
TYPE_PATTERN
protected static final int TYPE_PATTERN- See Also:
-
-
Constructor Details
-
JDKStringLikeSerializer
-
-
Method Details
-
find
-
isEmpty
Description copied from class:ValueSerializerMethod called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).Default implementation will consider only null values to be empty.
- Overrides:
isEmptyin classValueSerializer<Object>
-
serialize
public void serialize(Object value, JsonGenerator g, 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.g- 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 g, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException 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.- Overrides:
serializeWithTypein classValueSerializer<Object>- Parameters:
value- Value to serialize; can not be null.g- Generator used to output resulting Json contentctxt- 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
-
acceptJsonFormatVisitor
Description copied from class:StdSerializerDefault implementation specifies no format. This behavior is usually overriden by custom serializers.- Specified by:
acceptJsonFormatVisitorin interfaceJsonFormatVisitable- Overrides:
acceptJsonFormatVisitorin classStdSerializer<Object>typeHint- Type of element (entity like property) being visited
-