synergynetframework.appsystem.services.net.objectmessaging.utility.serializers
Class Serializer

java.lang.Object
  extended by synergynetframework.appsystem.services.net.objectmessaging.utility.serializers.Serializer
Direct Known Subclasses:
ArraySerializer, BeanSerializer, BooleanSerializer, ByteSerializer, CharSerializer, CollectionSerializer, CustomSerializer, DoubleSerializer, EnumSerializer, FieldSerializer, FloatSerializer, IntSerializer, LongSerializer, MapSerializer, SerializableSerializer, ShortSerializer, SimpleSerializer, StringSerializer

public abstract class Serializer
extends java.lang.Object

The Class Serializer.


Constructor Summary
Serializer()
           
 
Method Summary
<T> T
newInstance(java.lang.Class<T> type)
          New instance.
static boolean readNull(java.nio.ByteBuffer buffer)
          Read null.
<T> T
readObject(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Class<T> type)
          Read object.
<T> T
readObjectData(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Class<T> type)
          Read object data.
abstract
<T> T
readObjectData(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Class<T> type, boolean lengthKnown)
          Read object data.
 void setCanBeNull(boolean canBeNull)
          Sets the can be null.
static boolean writeNull(java.nio.ByteBuffer buffer, java.lang.Object object)
          Write null.
 void writeObject(ConnectionHandler connectionHandler, java.lang.Object object, java.nio.ByteBuffer buffer)
          Write object.
abstract  void writeObjectData(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Object object, boolean lengthKnown)
          Write object data.
 void writeObjectData(ConnectionHandler connectionHandler, java.lang.Object object, java.nio.ByteBuffer buffer)
          Write object data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Serializer

public Serializer()
Method Detail

readNull

public static boolean readNull(java.nio.ByteBuffer buffer)
Read null.

Parameters:
buffer - the buffer
Returns:
true, if successful

writeNull

public static boolean writeNull(java.nio.ByteBuffer buffer,
                                java.lang.Object object)
Write null.

Parameters:
buffer - the buffer
object - the object
Returns:
true, if successful

newInstance

public <T> T newInstance(java.lang.Class<T> type)
              throws SerializationException
New instance.

Type Parameters:
T - the generic type
Parameters:
type - the type
Returns:
the t
Throws:
SerializationException - the serialization exception

readObject

public final <T> T readObject(ConnectionHandler connectionHandler,
                              java.nio.ByteBuffer buffer,
                              java.lang.Class<T> type)
                   throws SerializationException
Read object.

Type Parameters:
T - the generic type
Parameters:
connectionHandler - the connection handler
buffer - the buffer
type - the type
Returns:
the t
Throws:
SerializationException - the serialization exception

readObjectData

public <T> T readObjectData(ConnectionHandler connectionHandler,
                            java.nio.ByteBuffer buffer,
                            java.lang.Class<T> type)
                 throws SerializationException
Read object data.

Type Parameters:
T - the generic type
Parameters:
connectionHandler - the connection handler
buffer - the buffer
type - the type
Returns:
the t
Throws:
SerializationException - the serialization exception

readObjectData

public abstract <T> T readObjectData(ConnectionHandler connectionHandler,
                                     java.nio.ByteBuffer buffer,
                                     java.lang.Class<T> type,
                                     boolean lengthKnown)
                          throws SerializationException
Read object data.

Type Parameters:
T - the generic type
Parameters:
connectionHandler - the connection handler
buffer - the buffer
type - the type
lengthKnown - the length known
Returns:
the t
Throws:
SerializationException - the serialization exception

setCanBeNull

public void setCanBeNull(boolean canBeNull)
Sets the can be null.

Parameters:
canBeNull - the new can be null

writeObject

public final void writeObject(ConnectionHandler connectionHandler,
                              java.lang.Object object,
                              java.nio.ByteBuffer buffer)
                       throws SerializationException
Write object.

Parameters:
connectionHandler - the connection handler
object - the object
buffer - the buffer
Throws:
SerializationException - the serialization exception

writeObjectData

public abstract void writeObjectData(ConnectionHandler connectionHandler,
                                     java.nio.ByteBuffer buffer,
                                     java.lang.Object object,
                                     boolean lengthKnown)
                              throws SerializationException
Write object data.

Parameters:
connectionHandler - the connection handler
buffer - the buffer
object - the object
lengthKnown - the length known
Throws:
SerializationException - the serialization exception

writeObjectData

public void writeObjectData(ConnectionHandler connectionHandler,
                            java.lang.Object object,
                            java.nio.ByteBuffer buffer)
                     throws SerializationException
Write object data.

Parameters:
connectionHandler - the connection handler
object - the object
buffer - the buffer
Throws:
SerializationException - the serialization exception