public class XStreamSerializer extends AbstractXStreamSerializer
XStream
Constructor and Description |
---|
XStreamSerializer()
Initialize a generic serializer using the UTF-8 character set.
|
XStreamSerializer(Charset charset)
Initialize the serializer using the given
charset . |
XStreamSerializer(Charset charset,
com.thoughtworks.xstream.XStream xStream,
RevisionResolver revisionResolver)
Initialize the serializer using the given
charset and xStream instance. |
XStreamSerializer(Charset charset,
com.thoughtworks.xstream.XStream xStream,
RevisionResolver revisionResolver,
Converter converter)
Initialize the serializer using the given
charset and xStream instance. |
XStreamSerializer(RevisionResolver revisionResolver)
Initialize a generic serializer using the UTF-8 character set.
|
XStreamSerializer(com.thoughtworks.xstream.XStream xStream)
Initialize a generic serializer using the UTF-8 character set.
|
XStreamSerializer(com.thoughtworks.xstream.XStream xStream,
RevisionResolver revisionResolver)
Initialize a generic serializer using the UTF-8 character set.
|
Modifier and Type | Method and Description |
---|---|
Object |
doDeserialize(SerializedObject serializedObject,
com.thoughtworks.xstream.XStream xStream)
Deserialize the given
serializedObject . |
protected <T> T |
doSerialize(Object object,
Class<T> expectedFormat,
com.thoughtworks.xstream.XStream xStream)
Serialize the given
object to the given expectedFormat . |
protected void |
registerConverters(ChainingConverter converter)
Registers any converters that are specific to the type of content written by this serializer.
|
addAlias, addFieldAlias, addPackageAlias, canSerializeTo, classForType, convert, deserialize, getCharset, getConverter, getXStream, serialize, typeForClass
public XStreamSerializer()
XppDriver
) is used to perform the serialization.public XStreamSerializer(RevisionResolver revisionResolver)
XppDriver
) is used to perform the serialization.revisionResolver
- The strategy to use to resolve the revision of an objectpublic XStreamSerializer(com.thoughtworks.xstream.XStream xStream)
xStream
- XStream instance to usepublic XStreamSerializer(com.thoughtworks.xstream.XStream xStream, RevisionResolver revisionResolver)
xStream
- XStream instance to userevisionResolver
- The strategy to use to resolve the revision of an objectpublic XStreamSerializer(Charset charset)
charset
. A default XStream instance (with XppDriver
) is used to perform the serialization.charset
- The character set to usepublic XStreamSerializer(Charset charset, com.thoughtworks.xstream.XStream xStream, RevisionResolver revisionResolver)
charset
and xStream
instance. The
xStream
instance is configured with several converters for the most common types in Axon.charset
- The character set to usexStream
- The XStream instance to userevisionResolver
- The strategy to use to resolve the revision of an objectpublic XStreamSerializer(Charset charset, com.thoughtworks.xstream.XStream xStream, RevisionResolver revisionResolver, Converter converter)
charset
and xStream
instance. The given
converter
is used to convert serialized objects for use by Upcasters. The
xStream
instance is configured with several converters for the most common types in Axon.charset
- The character set to usexStream
- The XStream instance to userevisionResolver
- The strategy to use to resolve the revision of an objectconverter
- The factory providing the converter instances for upcastersprotected <T> T doSerialize(Object object, Class<T> expectedFormat, com.thoughtworks.xstream.XStream xStream)
AbstractXStreamSerializer
object
to the given expectedFormat
. The subclass may use AbstractXStreamSerializer.convert(Object, Class, Class)
to convert the result of the serialization to the expected type.doSerialize
in class AbstractXStreamSerializer
T
- The format in which the serialized object must be returnedobject
- The object to serializeexpectedFormat
- The format in which the serialized object must be returnedxStream
- The XStream instance to serialize withpublic Object doDeserialize(SerializedObject serializedObject, com.thoughtworks.xstream.XStream xStream)
AbstractXStreamSerializer
serializedObject
.doDeserialize
in class AbstractXStreamSerializer
serializedObject
- The instance containing the serialized format of the objectxStream
- The XStream instance to deserialize withprotected void registerConverters(ChainingConverter converter)
AbstractXStreamSerializer
registerConverters
in class AbstractXStreamSerializer
converter
- the Converter to register the converters withCopyright © 2010–2018. All rights reserved.