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, Caching
- 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
Method Summary |
boolean |
canConvert(Class type)
Determines whether the converter can marshall a particular type. |
void |
doMarshal(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
|
protected void |
doMarshalConditionally(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
|
Object |
doUnmarshal(Object result,
HierarchicalStreamReader reader,
UnmarshallingContext context)
|
protected Object |
doUnmarshalConditionally(Object result,
HierarchicalStreamReader reader,
UnmarshallingContext context)
|
protected List |
hierarchyFor(Class type)
|
protected void |
marshalUnserializableParent(HierarchicalStreamWriter writer,
MarshallingContext context,
Object replacedSource)
|
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,
ClassLoader classLoader)
SerializableConverter
public SerializableConverter(Mapper mapper,
ReflectionProvider reflectionProvider)
- Deprecated. As of 1.4 use
SerializableConverter(Mapper, ReflectionProvider, ClassLoader)
canConvert
public boolean canConvert(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(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
- Overrides:
doMarshal
in class AbstractReflectionConverter
marshalUnserializableParent
protected void marshalUnserializableParent(HierarchicalStreamWriter writer,
MarshallingContext context,
Object replacedSource)
hierarchyFor
protected List hierarchyFor(Class type)
doUnmarshal
public Object doUnmarshal(Object result,
HierarchicalStreamReader reader,
UnmarshallingContext context)
- Overrides:
doUnmarshal
in class AbstractReflectionConverter
doMarshalConditionally
protected void doMarshalConditionally(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
doUnmarshalConditionally
protected Object doUnmarshalConditionally(Object result,
HierarchicalStreamReader reader,
UnmarshallingContext context)
Copyright © 2004-2014 XStream. All Rights Reserved.