de.javakaffee.web.msm.serializer.javolution
Class CGLibProxyFormat

java.lang.Object
  extended by javolution.xml.XMLFormat<T>
      extended by de.javakaffee.web.msm.serializer.javolution.CustomXMLFormat<Object>
          extended by de.javakaffee.web.msm.serializer.javolution.CGLibProxyFormat

public class CGLibProxyFormat
extends CustomXMLFormat<Object>

A format that serializes/deserializes cglib proxies.

Author:
Martin Grotzke

Nested Class Summary
static interface CGLibProxyFormat.CGLibProxyMarker
          This class is used as a marker class - written to the class attribute on serialization and checked on deserialization (via canConvert(Class).
 
Nested classes/interfaces inherited from class javolution.xml.XMLFormat
javolution.xml.XMLFormat.InputElement, javolution.xml.XMLFormat.OutputElement
 
Field Summary
 
Fields inherited from class javolution.xml.XMLFormat
APPENDABLE_XML, BOOLEAN_XML, BYTE_XML, CHARACTER_XML, CLASS_XML, COLLECTION_XML, CONFIGURABLE_XML, DOUBLE_XML, FAST_COLLECTION_XML, FAST_COMPARATOR_XML, FAST_MAP_XML, FLOAT_XML, INDEX_XML, INTEGER_XML, LONG_XML, MAP_XML, OBJECT_ARRAY_XML, OBJECT_XML, PERSISTENT_CONTEXT_XML, QNAME_XML, SHORT_XML, STRING_XML, TEXT_XML
 
Constructor Summary
CGLibProxyFormat()
           
 
Method Summary
 boolean canConvert(Class<?> cls)
          Used to determine if this XMLFormat can handle the given class, both during serialization and deserialization.
 Class<?> getTargetClass(Class<?> cls)
          Used to determine the class that is used for writing the class attribute to the serialized xml.
 boolean isReferenceable()
          
 Object newInstance(Class<Object> cls, javolution.xml.XMLFormat.InputElement xml)
          
 void read(javolution.xml.XMLFormat.InputElement arg0, Object arg1)
          
 void write(Object obj, javolution.xml.XMLFormat.OutputElement xml)
          
 
Methods inherited from class javolution.xml.XMLFormat
getBoundClass, getDefault, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CGLibProxyFormat

public CGLibProxyFormat()
Method Detail

canConvert

public boolean canConvert(Class<?> cls)
Used to determine if this XMLFormat can handle the given class, both during serialization and deserialization.

Specified by:
canConvert in class CustomXMLFormat<Object>
Parameters:
cls - the class to check
Returns:
true if this XMLFormat serializes/deserializes instances of the provided class.

getTargetClass

public Class<?> getTargetClass(Class<?> cls)
Used to determine the class that is used for writing the class attribute to the serialized xml.

This implementation returns a marker class so that we know on deserialization that we should handle/deserialize the serialized xml.

Overrides:
getTargetClass in class CustomXMLFormat<Object>
Parameters:
the - proxy class
Returns:
the marker class CGLibProxyFormat.CGLibProxyMarker.
See Also:
canConvert(Class)

isReferenceable

public boolean isReferenceable()

Overrides:
isReferenceable in class javolution.xml.XMLFormat<Object>

newInstance

public Object newInstance(Class<Object> cls,
                          javolution.xml.XMLFormat.InputElement xml)
                   throws javolution.xml.stream.XMLStreamException

Overrides:
newInstance in class javolution.xml.XMLFormat<Object>
Throws:
javolution.xml.stream.XMLStreamException

read

public void read(javolution.xml.XMLFormat.InputElement arg0,
                 Object arg1)
          throws javolution.xml.stream.XMLStreamException

Specified by:
read in class javolution.xml.XMLFormat<Object>
Throws:
javolution.xml.stream.XMLStreamException

write

public void write(Object obj,
                  javolution.xml.XMLFormat.OutputElement xml)
           throws javolution.xml.stream.XMLStreamException

Specified by:
write in class javolution.xml.XMLFormat<Object>
Throws:
javolution.xml.stream.XMLStreamException


Copyright © 2009-2012. All Rights Reserved.