com.sibvisions.rad.remote.serializer
Class ListSerializer

java.lang.Object
  extended by com.sibvisions.rad.remote.serializer.AbstractSizedSerializer
      extended by com.sibvisions.rad.remote.serializer.ListSerializer
All Implemented Interfaces:
ITypeSerializer<List>

public class ListSerializer
extends AbstractSizedSerializer
implements ITypeSerializer<List>

The serializer for any kind of List.


Constructor Summary
ListSerializer()
          Constructs a new instance of ListSerializer with support for ArrayList, ArrayUtil and Vector.
 
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<List> getTypeClass()
          Gets the type class that can be serialized by this serializer.
 List read(UniversalSerializer pSerializer, DataInputStream pIn, int pTypeValue, TypeCache pCache)
          Reads in a serialized object from a stream.
 void registerList(Class<? extends List> pListType)
          Registers a list type.
 void write(UniversalSerializer pSerializer, DataOutputStream pOut, List pObject, TypeCache pCache)
          Writes a serialized object to a stream.
 
Methods inherited from class com.sibvisions.rad.remote.serializer.AbstractSizedSerializer
readSize, writeSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListSerializer

public ListSerializer()
Constructs a new instance of ListSerializer with support for ArrayList, ArrayUtil and Vector.

Method Detail

getTypeClass

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

Specified by:
getTypeClass in interface ITypeSerializer<List>
Returns:
the type class.

getMinValue

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

Specified by:
getMinValue in interface ITypeSerializer<List>
Returns:
the minimal value used to detect this type in stream.

getMaxValue

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

Specified by:
getMaxValue in interface ITypeSerializer<List>
Returns:
the maximal value used to detect this type in stream.

read

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

Specified by:
read in interface ITypeSerializer<List>
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

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

Specified by:
write in interface ITypeSerializer<List>
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

registerList

public void registerList(Class<? extends List> pListType)
Registers a list type.

Parameters:
pListType - list type.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.