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

public Class DeserializingConverter

extends Object
implements Converter<byte[], Object>
Class Inheritance
All Implemented Interfaces
org.springframework.core.convert.converter.Converter
Imports
java.io.ByteArrayInputStream, org.springframework.core.convert.converter.Converter, org.springframework.core.serializer.DefaultDeserializer, .Deserializer, org.springframework.lang.Nullable, org.springframework.util.Assert

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

Field Summary

Modifier and TypeField and Description
private final Deserializer<Object>

Constructor Summary

AccessConstructor and Description
public
DeserializingConverter()

Create a DeserializingConverter with default java.io.ObjectInputStream configuration, using the "latest user-defined ClassLoader".

public
DeserializingConverter(ClassLoader
the ClassLoader to use
classLoader
)

Create a DeserializingConverter for using an java.io.ObjectInputStream with the given ClassLoader.

public
DeserializingConverter(Deserializer<Object> deserializer)

Create a DeserializingConverter that delegates to the provided Deserializer.

Method Summary

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

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

Convert the source object of type S to target type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deserializerback to summary
private final Deserializer<Object> deserializer

Constructor Detail

DeserializingConverterback to summary
public DeserializingConverter()

Create a DeserializingConverter with default java.io.ObjectInputStream configuration, using the "latest user-defined ClassLoader".

See Also
DefaultDeserializer#DefaultDeserializer()
DeserializingConverterback to summary
public DeserializingConverter(ClassLoader classLoader)

Create a DeserializingConverter for using an java.io.ObjectInputStream with the given ClassLoader.

Parameters
classLoader:ClassLoader

the ClassLoader to use

Since
4.2.1
See Also
DefaultDeserializer#DefaultDeserializer(ClassLoader)
DeserializingConverterback to summary
public DeserializingConverter(Deserializer<Object> deserializer)

Create a DeserializingConverter that delegates to the provided Deserializer.

Method Detail

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

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

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

Convert the source object of type S to target type T.

Parameters
source:byte[]

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

Returns:Object

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

Annotations
@Override