Top Description Fields Constructors Methods
com.thoughtworks.xstream.converters.reflection

public Class ExternalizableConverter

extends Object
implements Converter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
Imports
com.thoughtworks.xstream.converters.ConversionException, .Converter, .MarshallingContext, .UnmarshallingContext, com.thoughtworks.xstream.core.ClassLoaderReference, .JVM, .ReferencingMarshallingContext, com.thoughtworks.xstream.core.util.CustomObjectInputStream, .CustomObjectOutputStream, .HierarchicalStreams, .SerializationMembers, com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriterHelper, .HierarchicalStreamReader, .HierarchicalStreamWriter, .StreamException, com.thoughtworks.xstream.mapper.Mapper, java.io.Externalizable, .IOException, .NotActiveException, .ObjectInputValidation, java.lang.reflect.Constructor, .InvocationTargetException, java.util.Map

Converts any object that implements the java.io.Externalizable interface, allowing compatibility with native Java serialization.
Author
Joe Walnes

Field Summary

Modifier and TypeField and Description
private final ClassLoaderReference
private Mapper
private transient SerializationMembers

Constructor Summary

AccessConstructor and Description
public
ExternalizableConverter(Mapper
the Mapper chain
mapper
,
ClassLoaderReference
the reference to XStream's ClassLoader instance
classLoaderReference
)

Construct an ExternalizableConverter.

public
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canConvert(Class<T>
the Class representing the object type to be converted
type
)

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.
public void
marshal(final Object
The object to be marshalled.
original
,
final HierarchicalStreamWriter
A stream to write to.
writer
,
final MarshallingContext
A context that allows nested objects to be processed by XStream.
context
)

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.
private Object
public Object
unmarshal(final HierarchicalStreamReader
The stream to read the text from.
reader
,
final UnmarshallingContext context)

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderReferenceback to summary
private final ClassLoaderReference classLoaderReference
mapperback to summary
private Mapper mapper
serializationMembersback to summary
private transient SerializationMembers serializationMembers

Constructor Detail

ExternalizableConverterback to summary
public ExternalizableConverter(Mapper mapper, ClassLoaderReference classLoaderReference)

Construct an ExternalizableConverter.

Parameters
mapper:Mapper

the Mapper chain

classLoaderReference:ClassLoaderReference

the reference to XStream's ClassLoader instance

Since
1.4.5
ExternalizableConverterback to summary
public ExternalizableConverter(Mapper mapper, ClassLoader classLoader)
ExternalizableConverterback to summary
public ExternalizableConverter(Mapper mapper)

Method Detail

canConvertback to summary
public boolean canConvert(Class<T> type)

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Doc from com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.

Parameters
type:Class<T>

the Class representing the object type to be converted

marshalback to summary
public void marshal(final Object original, final HierarchicalStreamWriter writer, final MarshallingContext context)

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Doc from com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.

Parameters
original:Object

The object to be marshalled.

writer:HierarchicalStreamWriter

A stream to write to.

context:MarshallingContext

A context that allows nested objects to be processed by XStream.

readResolveback to summary
private Object readResolve()
unmarshalback to summary
public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context)

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Doc from com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.

Parameters
reader:HierarchicalStreamReader

The stream to read the text from.

Returns:Object

The resulting object.