com.sibvisions.rad.remote.serializer
Class EnumSerializer

java.lang.Object
  extended by com.sibvisions.rad.remote.serializer.EnumSerializer
All Implemented Interfaces:
ITypeSerializer<Enum>

public class EnumSerializer
extends Object
implements ITypeSerializer<Enum>

The serializer for Enum.


Field Summary
static int TYPE_ENUM
          value of type.
 
Constructor Summary
EnumSerializer()
           
 
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<Enum> getTypeClass()
          Gets the type class that can be serialized by this serializer.
 Enum read(UniversalSerializer pSerializer, DataInputStream pIn, int pTypeValue, TypeCache pCache)
          Reads in a serialized object from a stream.
 void write(UniversalSerializer pSerializer, DataOutputStream pOut, Enum pEnum, TypeCache pCache)
          Writes a serialized object to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_ENUM

public static final int TYPE_ENUM
value of type.

See Also:
Constant Field Values
Constructor Detail

EnumSerializer

public EnumSerializer()
Method Detail

getTypeClass

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

Specified by:
getTypeClass in interface ITypeSerializer<Enum>
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<Enum>
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<Enum>
Returns:
the maximal value used to detect this type in stream.

read

public Enum 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<Enum>
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,
                  Enum pEnum,
                  TypeCache pCache)
           throws Exception
Writes a serialized object to a stream.

Specified by:
write in interface ITypeSerializer<Enum>
Parameters:
pSerializer - the universal serializer.
pOut - output stream for the object
pEnum - serializable object
pCache - the cache for BeanType definitions
Throws:
Exception - if serialization fails


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.