org.clazzes.remoting.marshal.impl
Class MarshalerClassRegistry

java.lang.Object
  extended by org.clazzes.remoting.marshal.impl.MarshalerClassRegistry

public class MarshalerClassRegistry
extends java.lang.Object

A registry for known classes to marshal.

Author:
wglas

Constructor Summary
MarshalerClassRegistry()
           
 
Method Summary
 ClassInfo getClassInfo(java.lang.Class<?> c, boolean extend)
          Get the default ClassInfo for the given class upon serialization.
 org.clazzes.remoting.marshal.impl.ObjectMarshaler getObjectMarshaler(ClassInfo ci, java.lang.ClassLoader classLoader)
          Get the registered order of fields for the given ClassInfo.
 ClassInfo registerClass(java.lang.Class<?> c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarshalerClassRegistry

public MarshalerClassRegistry()
Method Detail

registerClass

public ClassInfo registerClass(java.lang.Class<?> c)

getClassInfo

public ClassInfo getClassInfo(java.lang.Class<?> c,
                              boolean extend)
                       throws java.lang.IllegalArgumentException
Get the default ClassInfo for the given class upon serialization.

Parameters:
c - The class for which to fetch the default ClassInfo.
extend - Whether the list of registered classes should be extended, if c is not yet registered.
Returns:
The ClassInfo with the actual serialVersionUID.
Throws:
java.lang.IllegalArgumentException - If the class is not yet registered and extend is set to false.

getObjectMarshaler

public org.clazzes.remoting.marshal.impl.ObjectMarshaler getObjectMarshaler(ClassInfo ci,
                                                                            java.lang.ClassLoader classLoader)
                                                                     throws java.lang.ClassNotFoundException
Get the registered order of fields for the given ClassInfo.

Parameters:
ci - The class info, typically read from an input stream.
classLoader - If not null, the list of registered classes is extended by loading the class with name contained in ci from the specified class loader.
Returns:
The order list of fields to serialize.
Throws:
java.lang.IllegalArgumentException - If the given class info could not be found or the given class could not be loaded from the given class loader.
java.lang.ClassNotFoundException


Copyright © 2010. All Rights Reserved.