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

java.lang.Object
  extended by synergynetframework.appsystem.services.net.objectmessaging.utility.serializers.Serializer
      extended by synergynetframework.appsystem.services.net.objectmessaging.utility.serializers.ArraySerializer

public class ArraySerializer
extends Serializer

The Class ArraySerializer.


Constructor Summary
ArraySerializer()
          Instantiates a new array serializer.
ArraySerializer(java.lang.Integer dimensions)
          Instantiates a new array serializer.
ArraySerializer(java.lang.Integer dimensions, boolean elementsAreNotNull, boolean elementsAreSameType)
          Instantiates a new array serializer.
 
Method Summary
static
<T> T
get(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Class<T> type, java.lang.Integer dimensions, boolean elementsAreNotNull, boolean elementsAreSameType)
          Gets the.
static int getDimensionCount(java.lang.Class<?> arrayClass)
          Gets the dimension count.
static int[] getDimensions(java.lang.Object array)
          Gets the dimensions.
static java.lang.Class<?> getElementClass(java.lang.Class<?> arrayClass)
          Gets the element class.
static void put(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Object array, java.lang.Integer dimensions, boolean elementsAreNotNull, boolean elementsAreSameType)
          Put.
<T> T
readObjectData(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Class<T> type, boolean lengthKnown)
          Read object data.
 void writeObjectData(ConnectionHandler connectionHandler, java.nio.ByteBuffer buffer, java.lang.Object array, boolean lengthKnown)
          Write object data.
 
Methods inherited from class synergynetframework.appsystem.services.net.objectmessaging.utility.serializers.Serializer
newInstance, readNull, readObject, readObjectData, setCanBeNull, writeNull, writeObject, writeObjectData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArraySerializer

public ArraySerializer()
Instantiates a new array serializer.


ArraySerializer

public ArraySerializer(java.lang.Integer dimensions)
Instantiates a new array serializer.

Parameters:
dimensions - the dimensions

ArraySerializer

public ArraySerializer(java.lang.Integer dimensions,
                       boolean elementsAreNotNull,
                       boolean elementsAreSameType)
Instantiates a new array serializer.

Parameters:
dimensions - the dimensions
elementsAreNotNull - the elements are not null
elementsAreSameType - the elements are same type
Method Detail

get

public static <T> T get(ConnectionHandler connectionHandler,
                        java.nio.ByteBuffer buffer,
                        java.lang.Class<T> type,
                        java.lang.Integer dimensions,
                        boolean elementsAreNotNull,
                        boolean elementsAreSameType)
             throws SerializationException
Gets the.

Type Parameters:
T - the generic type
Parameters:
connectionHandler - the connection handler
buffer - the buffer
type - the type
dimensions - the dimensions
elementsAreNotNull - the elements are not null
elementsAreSameType - the elements are same type
Returns:
the t
Throws:
SerializationException - the serialization exception

getDimensionCount

public static int getDimensionCount(java.lang.Class<?> arrayClass)
Gets the dimension count.

Parameters:
arrayClass - the array class
Returns:
the dimension count

getDimensions

public static int[] getDimensions(java.lang.Object array)
Gets the dimensions.

Parameters:
array - the array
Returns:
the dimensions

getElementClass

public static java.lang.Class<?> getElementClass(java.lang.Class<?> arrayClass)
Gets the element class.

Parameters:
arrayClass - the array class
Returns:
the element class

put

public static void put(ConnectionHandler connectionHandler,
                       java.nio.ByteBuffer buffer,
                       java.lang.Object array,
                       java.lang.Integer dimensions,
                       boolean elementsAreNotNull,
                       boolean elementsAreSameType)
                throws SerializationException
Put.

Parameters:
connectionHandler - the connection handler
buffer - the buffer
array - the array
dimensions - the dimensions
elementsAreNotNull - the elements are not null
elementsAreSameType - the elements are same type
Throws:
SerializationException - the serialization exception

readObjectData

public <T> T readObjectData(ConnectionHandler connectionHandler,
                            java.nio.ByteBuffer buffer,
                            java.lang.Class<T> type,
                            boolean lengthKnown)
                 throws SerializationException
Description copied from class: Serializer
Read object data.

Specified by:
readObjectData in class Serializer
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

writeObjectData

public void writeObjectData(ConnectionHandler connectionHandler,
                            java.nio.ByteBuffer buffer,
                            java.lang.Object array,
                            boolean lengthKnown)
                     throws SerializationException
Description copied from class: Serializer
Write object data.

Specified by:
writeObjectData in class Serializer
Parameters:
connectionHandler - the connection handler
buffer - the buffer
array - the object
lengthKnown - the length known
Throws:
SerializationException - the serialization exception