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,LambdaConverter
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()
- getFields(), putFields(), writeFields(), readFields()
- ObjectStreamField[] serialPersistentFields
- ObjectInputValidation
- Author:
- Joe Walnes, Jörg Schaible
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
AbstractReflectionConverter.DuplicateFieldException, AbstractReflectionConverter.UnknownFieldException
-
-
Field Summary
-
Fields inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
mapper, reflectionProvider, serializationMembers, serializationMethodInvoker
-
-
Constructor Summary
Constructors Constructor Description SerializableConverter(Mapper mapper, ReflectionProvider reflectionProvider)Deprecated.SerializableConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference)Construct a SerializableConverter.SerializableConverter(Mapper mapper, ReflectionProvider reflectionProvider, java.lang.ClassLoader classLoader)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConvert(java.lang.Class type)Determines whether the converter can marshall a particular type.voiddoMarshal(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)protected voiddoMarshalConditionally(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)java.lang.ObjectdoUnmarshal(java.lang.Object result, HierarchicalStreamReader reader, UnmarshallingContext context)protected java.lang.ObjectdoUnmarshalConditionally(java.lang.Object result, HierarchicalStreamReader reader, UnmarshallingContext context)protected java.util.ListhierarchyFor(java.lang.Class type)protected voidmarshalUnserializableParent(HierarchicalStreamWriter writer, MarshallingContext context, java.lang.Object replacedSource)-
Methods inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
canAccess, flushCache, instantiateNewInstance, marshal, marshallField, readResolve, shouldUnmarshalField, shouldUnmarshalTransientFields, unmarshal, unmarshallField
-
-
-
-
Constructor Detail
-
SerializableConverter
public SerializableConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference)
Construct a SerializableConverter.- Parameters:
mapper- the mapper chain instancereflectionProvider- the reflection providerclassLoaderReference- the reference to theClassLoaderof the XStream instance- Since:
- 1.4.5
-
SerializableConverter
public SerializableConverter(Mapper mapper, ReflectionProvider reflectionProvider, java.lang.ClassLoader classLoader)
Deprecated.
-
SerializableConverter
public SerializableConverter(Mapper mapper, ReflectionProvider reflectionProvider)
Deprecated.
-
-
Method Detail
-
canConvert
public boolean canConvert(java.lang.Class type)
Description copied from interface:ConverterMatcherDetermines 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:
doMarshalin classAbstractReflectionConverter
-
marshalUnserializableParent
protected void marshalUnserializableParent(HierarchicalStreamWriter writer, MarshallingContext context, java.lang.Object replacedSource)
-
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:
doUnmarshalin classAbstractReflectionConverter
-
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)
-
-