Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.ser.std

public Class ToStringSerializer

extends ToStringSerializerBase
Class Inheritance
Annotations
@JacksonStdImpl
@SuppressWarnings:serial
Imports
com.fasterxml.jackson.databind.annotation.JacksonStdImpl

References Deprecated

ToStringSerializerBase is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Simple general purpose serializer, useful for any type for which Object#toString returns the desired JSON value.

Since 2.10 extends ToStringSerializerBase

Field Summary

Modifier and TypeField and Description
public static final ToStringSerializer
instance

References Deprecated ToStringSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
Singleton instance to use.

Constructor Summary

AccessConstructor and Description
public
ToStringSerializer()

Note

usually you should NOT create new instances, but instead use instance which is stateless and fully thread-safe.

public
ToStringSerializer(Class<?> handledType)

Sometimes it may actually make sense to retain actual handled type.

Method Summary

Modifier and TypeMethod and Description
public final String
Inherited from com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase:
acceptJsonFormatVisitorgetSchemaisEmptyserializeserializeWithType

Field Detail

instanceback to summary
public static final ToStringSerializer instance

References Deprecated

ToStringSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Singleton instance to use.

Constructor Detail

ToStringSerializerback to summary
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 like com.fasterxml.jackson.databind.annotation.JsonSerialize#using.

ToStringSerializerback to summary
public ToStringSerializer(Class<?> handledType)

Sometimes it may actually make sense to retain actual handled type.

Since
2.5

Method Detail

valueToStringback to summary
public final String valueToString(Object value)

Implements abstract com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase.valueToString.

Annotations
@Override