Top Description Fields Constructors Methods
org.springframework.core.serializer.support

public Class SerializingConverter

extends Object
implements Converter<Object, byte[]>
Class Inheritance
All Implemented Interfaces
org.springframework.core.convert.converter.Converter
Imports
org.springframework.core.convert.converter.Converter, org.springframework.core.serializer.DefaultSerializer, .Serializer, org.springframework.util.Assert

A Converter that delegates to a org.springframework.core.serializer.Serializer to convert an object to a byte array.
Authors
Gary Russell, Mark Fisher
Since
3.0.5

Field Summary

Modifier and TypeField and Description
private final Serializer<Object>

Constructor Summary

AccessConstructor and Description
public
SerializingConverter()

Create a default SerializingConverter that uses standard Java serialization.

public
SerializingConverter(Serializer<Object> serializer)

Create a SerializingConverter that delegates to the provided Serializer.

Method Summary

Modifier and TypeMethod and Description
public byte[]
convert(Object
the source object to convert, which must be an instance of S (never null)
source
)

Implements org.springframework.core.convert.converter.Converter.convert.

Serializes the source object and returns the byte array result.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serializerback to summary
private final Serializer<Object> serializer

Constructor Detail

SerializingConverterback to summary
public SerializingConverter()

Create a default SerializingConverter that uses standard Java serialization.

SerializingConverterback to summary
public SerializingConverter(Serializer<Object> serializer)

Create a SerializingConverter that delegates to the provided Serializer.

Method Detail

convertback to summary
public byte[] convert(Object source)

Implements org.springframework.core.convert.converter.Converter.convert.

Serializes the source object and returns the byte array result.

Parameters
source:Object

Doc from org.springframework.core.convert.converter.Converter.convert.

the source object to convert, which must be an instance of S (never null)

Returns:byte[]

Doc from org.springframework.core.convert.converter.Converter.convert.

the converted object, which must be an instance of T (potentially null)

Annotations
@Override