com.thoughtworks.xstream.converters.reflection
Class CGLIBEnhancedConverter

java.lang.Object
  extended by com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
      extended by com.thoughtworks.xstream.converters.reflection.SerializableConverter
          extended by com.thoughtworks.xstream.converters.reflection.CGLIBEnhancedConverter
All Implemented Interfaces:
Converter, ConverterMatcher

public class CGLIBEnhancedConverter
extends SerializableConverter

Converts a proxy created by the CGLIB Enhancer. Such a proxy is recreated while deserializing the proxy. The converter does only work, if

Note, that the this converter relies on the CGLIBMapper.

Since:
1.2
Author:
Jörg Schaible

Nested Class Summary
 
Nested classes/interfaces inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
AbstractReflectionConverter.DuplicateFieldException
 
Field Summary
 
Fields inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
reflectionProvider, serializationMethodInvoker
 
Constructor Summary
CGLIBEnhancedConverter(Mapper mapper, ReflectionProvider reflectionProvider)
           
 
Method Summary
 boolean canConvert(java.lang.Class type)
          Determines whether the converter can marshall a particular type.
protected  java.util.List hierarchyFor(java.lang.Class type)
           
 void marshal(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)
          Convert an object to textual data.
 java.lang.Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
          Convert textual data back into an object.
 
Methods inherited from class com.thoughtworks.xstream.converters.reflection.SerializableConverter
doMarshal, doMarshalConditionally, doUnmarshal, doUnmarshalConditionally
 
Methods inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
instantiateNewInstance, marshallField, unmarshallField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CGLIBEnhancedConverter

public CGLIBEnhancedConverter(Mapper mapper,
                              ReflectionProvider reflectionProvider)
Method Detail

canConvert

public boolean canConvert(java.lang.Class type)
Description copied from interface: ConverterMatcher
Determines whether the converter can marshall a particular type.

Specified by:
canConvert in interface ConverterMatcher
Overrides:
canConvert in class SerializableConverter
Parameters:
type - the Class representing the object type to be converted

marshal

public void marshal(java.lang.Object source,
                    HierarchicalStreamWriter writer,
                    MarshallingContext context)
Description copied from interface: Converter
Convert an object to textual data.

Specified by:
marshal in interface Converter
Overrides:
marshal in class AbstractReflectionConverter
Parameters:
source - The object to be marshalled.
writer - A stream to write to.
context - A context that allows nested objects to be processed by XStream.

unmarshal

public java.lang.Object unmarshal(HierarchicalStreamReader reader,
                                  UnmarshallingContext context)
Description copied from interface: Converter
Convert textual data back into an object.

Specified by:
unmarshal in interface Converter
Overrides:
unmarshal in class AbstractReflectionConverter
Parameters:
reader - The stream to read the text from.
Returns:
The resulting object.

hierarchyFor

protected java.util.List hierarchyFor(java.lang.Class type)
Overrides:
hierarchyFor in class SerializableConverter


Joe Walnes, http://xstream.codehaus.org/