de.javakaffee.kryoserializers.cglib
Class CGLibProxySerializer

java.lang.Object
  extended by com.esotericsoftware.kryo.Serializer
      extended by com.esotericsoftware.kryo.serialize.SimpleSerializer<Object>
          extended by de.javakaffee.kryoserializers.cglib.CGLibProxySerializer

public class CGLibProxySerializer
extends com.esotericsoftware.kryo.serialize.SimpleSerializer<Object>

A kryo serializer for cglib proxies. It needs to be registered for CGLibProxySerializer.CGLibProxyMarker class. When the serializer for a certain class is requested (via Kryo.newSerializer(Class)) canSerialize(Class) has to be checked with the provided class to see if a CGLibProxySerializer should be returned.

Author:
Martin Grotzke

Nested Class Summary
static interface CGLibProxySerializer.CGLibProxyMarker
          This class is used as a marker class - written to the class attribute on serialization and checked on deserialization (via CGLibProxyFormat#canConvert(Class).
 
Constructor Summary
CGLibProxySerializer(com.esotericsoftware.kryo.Kryo kryo)
          Constructor.
 
Method Summary
static boolean canSerialize(Class<?> cls)
           
 Object read(ByteBuffer buffer)
          
 void write(ByteBuffer buffer, Object obj)
          
 
Methods inherited from class com.esotericsoftware.kryo.serialize.SimpleSerializer
readObjectData, writeObjectData
 
Methods inherited from class com.esotericsoftware.kryo.Serializer
isFinal, newInstance, readObject, setCanBeNull, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CGLibProxySerializer

public CGLibProxySerializer(com.esotericsoftware.kryo.Kryo kryo)
Constructor.

Parameters:
kryo - the kryo instance.
Method Detail

canSerialize

public static boolean canSerialize(Class<?> cls)

read

public Object read(ByteBuffer buffer)

Specified by:
read in class com.esotericsoftware.kryo.serialize.SimpleSerializer<Object>

write

public void write(ByteBuffer buffer,
                  Object obj)

Specified by:
write in class com.esotericsoftware.kryo.serialize.SimpleSerializer<Object>


Copyright © 2010-2011. All Rights Reserved.