com.sibvisions.rad.remote.serializer
Interface ITypeSerializer<T>

Type Parameters:
T - the type
All Known Implementing Classes:
ArraySerializer, BeanSerializer, BeanTypeSerializer, BooleanArraySerializer, BooleanSerializer, ByteArraySerializer, ByteSerializer, CharacterSerializer, CharArraySerializer, DateSerializer, DecimalSerializer, DoubleArraySerializer, DoubleSerializer, EnumSerializer, FloatArraySerializer, FloatSerializer, IntArraySerializer, IntegerSerializer, ListSerializer, LongArraySerializer, LongSerializer, MapSerializer, NullSerializer, ObjectSerializer, ShortArraySerializer, ShortSerializer, StringSerializer, ThrowableSerializer, XmlNodeSerializer

public interface ITypeSerializer<T>

The ITypeSerializer interface defines standard methods for serialization and deserialization of a specific type.


Method Summary
 int getMaxValue()
          Gets the maximal value used to detect this type in stream.
 int getMinValue()
          Gets the minimal value used to detect this type in stream.
 Class<T> getTypeClass()
          Gets the type class that can be serialized by this serializer.
 T read(UniversalSerializer pSerializer, DataInputStream pIn, int pTypeValue, TypeCache pCache)
          Reads in a serialized object from a stream.
 void write(UniversalSerializer pSerializer, DataOutputStream pOut, T pObject, TypeCache pCache)
          Writes a serialized object to a stream.
 

Method Detail

getTypeClass

Class<T> getTypeClass()
Gets the type class that can be serialized by this serializer.

Returns:
the type class.

getMinValue

int getMinValue()
Gets the minimal value used to detect this type in stream.

Returns:
the minimal value used to detect this type in stream.

getMaxValue

int getMaxValue()
Gets the maximal value used to detect this type in stream.

Returns:
the maximal value used to detect this type in stream.

read

T read(UniversalSerializer pSerializer,
       DataInputStream pIn,
       int pTypeValue,
       TypeCache pCache)
       throws Exception
Reads in a serialized object from a stream.

Parameters:
pSerializer - the universal serializer.
pIn - stream with serialized content
pTypeValue - type value.
pCache - the cache for BeanType definitions
Returns:
deserialized object
Throws:
Exception - if deserialization fails

write

void write(UniversalSerializer pSerializer,
           DataOutputStream pOut,
           T pObject,
           TypeCache pCache)
           throws Exception
Writes a serialized object to a stream.

Parameters:
pSerializer - the universal serializer.
pOut - output stream for the object
pObject - serializable object
pCache - the cache for BeanType definitions
Throws:
Exception - if serialization fails


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.