org.strutsme.server
Class SerializerMapper

java.lang.Object
  extended by org.strutsme.server.SerializerMapper

public class SerializerMapper
extends java.lang.Object

Maps from an arbitary object graph to an object graph which contains only objects supported by the Serializer.

This means that: - List is transformed into Vector - Map is transformed into SafeHashtable - for any other object a DTO class name is constructed based on the package prefix. Then the properties of the input object are copied into the DTO object.


Constructor Summary
SerializerMapper(java.lang.String packagePrefix)
           
 
Method Summary
 java.lang.Object map(java.lang.Object o)
          Recursive method to map the given object graph to an object graph which contains only objects which are supported by the Serializer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializerMapper

public SerializerMapper(java.lang.String packagePrefix)
Parameters:
packagePrefix - the package for the dto-Classes of the clientapp-common-module, where the common dtowrappers for the serverapplication resides.
Method Detail

map

public final java.lang.Object map(java.lang.Object o)
                           throws SerializationException
Recursive method to map the given object graph to an object graph which contains only objects which are supported by the Serializer.

Parameters:
o - the object to convert
Returns:
a container, a wrapper for a primitive type or a SerializationBase instance
Throws:
SerializationException - if a serialization related problem occurs