org.springframework.core.serializer.support

Class DeserializingConverter

  • java.lang.Object
    • org.springframework.core.serializer.support.DeserializingConverter
  • All Implemented Interfaces:
    Converter<byte[],java.lang.Object>


    public class DeserializingConverter
    extends java.lang.Object
    implements Converter<byte[],java.lang.Object>
    A Converter that delegates to a Deserializer to convert data in a byte array to an object.
    Since:
    3.0.5
    Author:
    Gary Russell, Mark Fisher, Juergen Hoeller
    • Constructor Summary

      Constructors 
      Constructor and Description
      DeserializingConverter()
      Create a DeserializingConverter with default ObjectInputStream configuration, using the "latest user-defined ClassLoader".
      DeserializingConverter(java.lang.ClassLoader classLoader)
      Create a DeserializingConverter for using an ObjectInputStream with the given ClassLoader.
      DeserializingConverter(Deserializer<java.lang.Object> deserializer)
      Create a DeserializingConverter that delegates to the provided Deserializer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object convert(byte[] source)
      Convert the source object of type S to target type T.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeserializingConverter

        public DeserializingConverter()
        Create a DeserializingConverter with default ObjectInputStream configuration, using the "latest user-defined ClassLoader".
        See Also:
        DefaultDeserializer.DefaultDeserializer()
      • DeserializingConverter

        public DeserializingConverter(Deserializer<java.lang.Object> deserializer)
        Create a DeserializingConverter that delegates to the provided Deserializer.
    • Method Detail

      • convert

        public java.lang.Object convert(byte[] source)
        Description copied from interface: Converter
        Convert the source object of type S to target type T.
        Specified by:
        convert in interface Converter<byte[],java.lang.Object>
        Parameters:
        source - the source object to convert, which must be an instance of S (never null)
        Returns:
        the converted object, which must be an instance of T (potentially null)