Top Description Fields Constructors Methods
tools.jackson.databind.ser.jdk

public Class JDKStringLikeSerializer

extends StdSerializer<Object>
Class Inheritance
Annotations
@JacksonStdImpl
Imports
java.io.File, java.net.URI, .URL, java.nio.file.Path, java.util.*, java.util.regex.Pattern, tools.jackson.core.*, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.*, tools.jackson.databind.annotation.JacksonStdImpl, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.ser.std.StdSerializer, .ToStringSerializer

"Combo" serializer used for JDK types that work almost like ToStringSerializer.
Since
3.0

Field Summary

Modifier and TypeField and Description
private final int
private static final Map<Class<?>, Integer>
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
Inherited from tools.jackson.databind.ser.std.StdSerializer:
_handledType

Constructor Summary

AccessConstructor and Description
public
JDKStringLikeSerializer(Class<?> handledType, int type)

Method Summary

Modifier and TypeMethod and Description
public void
public static final ValueSerializer<?>
find(Class<?> raw)

public boolean
isEmpty(SerializationContext prov, Object value)

Overrides tools.jackson.databind.ValueSerializer.isEmpty.

Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).

public void
serialize(Object value, JsonGenerator g, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.std.StdSerializer.serialize.

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.jackson.databind.ValueSerializer.serializeWithType.

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.

Inherited from tools.jackson.databind.ser.std.StdSerializer:
_neitherNull_nonEmpty_wrapIOFailureacceptJsonFormatVisitorForBinarycreateSchemaNodecreateSchemaNodefindAnnotatedContentSerializerfindContextualConvertingSerializerfindFormatFeaturefindFormatOverridesfindIncludeOverridesfindPropertyFilterhandledTypeisDefaultSerializervisitArrayFormatvisitArrayFormatvisitFloatFormatvisitIntFormatvisitIntFormatvisitStringFormatvisitStringFormatwrapAndThrowwrapAndThrow

Field Detail

_typeback to summary
private final int _type
_typesback to summary
private static final Map<Class<?>, Integer> _types
TYPE_CLASSback to summary
protected static final int TYPE_CLASS
TYPE_CURRENCYback to summary
protected static final int TYPE_CURRENCY
TYPE_FILEback to summary
protected static final int TYPE_FILE
TYPE_LOCALEback to summary
protected static final int TYPE_LOCALE
TYPE_PATHback to summary
protected static final int TYPE_PATH
TYPE_PATTERNback to summary
protected static final int TYPE_PATTERN
TYPE_URIback to summary
protected static final int TYPE_URI
TYPE_URLback to summary
protected static final int TYPE_URL

Constructor Detail

JDKStringLikeSerializerback to summary
public JDKStringLikeSerializer(Class<?> handledType, int type)

Method Detail

acceptJsonFormatVisitorback to summary
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)

Overrides tools.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

Implements tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable.acceptJsonFormatVisitor.

Doc from tools.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

Default implementation specifies no format. This behavior is usually overriden by custom serializers.

Annotations
@Override
findback to summary
public static final ValueSerializer<?> find(Class<?> raw)
isEmptyback to summary
public boolean isEmpty(SerializationContext prov, Object value)

Overrides tools.jackson.databind.ValueSerializer.isEmpty.

Doc from tools.jackson.databind.ValueSerializer.isEmpty.

Method 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.

Annotations
@Override
serializeback to summary
public void serialize(Object value, JsonGenerator g, SerializationContext provider) throws JacksonException

Implements abstract tools.jackson.databind.ser.std.StdSerializer.serialize.

Doc from tools.jackson.databind.ValueSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Annotations
@Override
serializeWithTypeback to summary
public void serializeWithType(Object value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException

Overrides tools.jackson.databind.ValueSerializer.serializeWithType.

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.

Annotations
@Override