Class ToStringSerializer
java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<Object>
com.fasterxml.jackson.databind.ser.std.StdSerializer<Object>
com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
- All Implemented Interfaces:
JsonFormatVisitable
,SchemaAware
,Serializable
Simple general purpose serializer, useful for any
type for which
Object.toString()
returns the desired JSON
value.
Since 2.10 extends ToStringSerializerBase
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
JsonSerializer.None
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNote: usually you should NOT create new instances, but instead useinstance
which is stateless and fully thread-safe.ToStringSerializer
(Class<?> handledType) Sometimes it may actually make sense to retain actual handled type. -
Method Summary
Methods inherited from class com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase
acceptJsonFormatVisitor, getSchema, isEmpty, serialize, serializeWithType
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
getSchema, handledType, wrapAndThrow, wrapAndThrow
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties
-
Field Details
-
instance
Singleton instance to use.
-
-
Constructor Details
-
ToStringSerializer
public ToStringSerializer()Note: usually you should NOT create new instances, but instead use
instance
which is stateless and fully thread-safe. However, there are cases where constructor is needed; for example, when using explicit serializer annotations likeJsonSerialize.using()
. -
ToStringSerializer
Sometimes it may actually make sense to retain actual handled type.- Since:
- 2.5
-
-
Method Details
-
valueToString
- Specified by:
valueToString
in classToStringSerializerBase
-