com.thoughtworks.xstream.converters.reflection
Class SerializableConverter
java.lang.Object
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
com.thoughtworks.xstream.converters.reflection.SerializableConverter
- All Implemented Interfaces:
- Converter, ConverterMatcher
- Direct Known Subclasses:
- CGLIBEnhancedConverter
public class SerializableConverter
- extends AbstractReflectionConverter
Emulates the mechanism used by standard Java Serialization for classes that implement java.io.Serializable AND
implement or inherit a custom readObject()/writeObject() method.
Supported features of serialization
- readObject(), writeObject()
- class inheritance
- readResolve(), writeReplace()
Currently unsupported features
- putFields(), writeFields(), readFields()
- ObjectStreamField[] serialPersistentFields
- ObjectInputValidation
- Author:
- Joe Walnes, Jörg Schaible
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SerializableConverter
public SerializableConverter(Mapper mapper,
ReflectionProvider reflectionProvider)
canConvert
public boolean canConvert(java.lang.Class type)
- Description copied from interface:
ConverterMatcher
- Determines whether the converter can marshall a particular type.
- Parameters:
type
- the Class representing the object type to be converted
doMarshal
public void doMarshal(java.lang.Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
- Overrides:
doMarshal
in class AbstractReflectionConverter
hierarchyFor
protected java.util.List hierarchyFor(java.lang.Class type)
doUnmarshal
public java.lang.Object doUnmarshal(java.lang.Object result,
HierarchicalStreamReader reader,
UnmarshallingContext context)
- Overrides:
doUnmarshal
in class AbstractReflectionConverter
doMarshalConditionally
protected void doMarshalConditionally(java.lang.Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
doUnmarshalConditionally
protected java.lang.Object doUnmarshalConditionally(java.lang.Object result,
HierarchicalStreamReader reader,
UnmarshallingContext context)
Copyright © 2004-2012 XStream. All Rights Reserved.