|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.serializer.AbstractXStreamSerializer org.axonframework.mongo3.serializer.bson.DBObjectXStreamSerializer
public class DBObjectXStreamSerializer
XStream based serializer implementation that serializes objects into a Binary JSON structure. This serializer is originally meant for use with a MongoDB based Event Store. It escapes BSON Node names to prevent them containing periods (".").
Constructor Summary | |
---|---|
DBObjectXStreamSerializer()
Initialize the serializer with UTF-8 character set and a default XStream serializer. |
|
DBObjectXStreamSerializer(Charset charset)
Initialize the serializer using the given charset . |
|
DBObjectXStreamSerializer(Charset charset,
com.thoughtworks.xstream.XStream xStream)
Initialize the serializer using the given charset and xStream instance. |
|
DBObjectXStreamSerializer(Charset charset,
com.thoughtworks.xstream.XStream xStream,
RevisionResolver revisionResolver)
Initialize the serializer using the given charset , xStream and
revisionResolver instance. |
|
DBObjectXStreamSerializer(Charset charset,
com.thoughtworks.xstream.XStream xStream,
RevisionResolver revisionResolver,
ConverterFactory converterFactory)
Initialize the serializer using the given charset and xStream instance. |
|
DBObjectXStreamSerializer(com.thoughtworks.xstream.XStream xStream)
Initialize the serializer using the UTF-8 character set. |
|
DBObjectXStreamSerializer(com.thoughtworks.xstream.XStream xStream,
RevisionResolver revisionResolver)
Initialize the serializer using the UTF-8 character set. |
Method Summary | ||
---|---|---|
protected Object |
doDeserialize(SerializedObject serializedObject,
com.thoughtworks.xstream.XStream xStream)
Deserialize the given serializedObject . |
|
protected
|
doSerialize(Object object,
Class<T> expectedFormat,
com.thoughtworks.xstream.XStream xStream)
Serialize the given object to the given expectedFormat . |
|
protected void |
registerConverters(ChainingConverterFactory converterFactory)
Registers any converters that are specific to the type of content written by this serializer. |
Methods inherited from class org.axonframework.serializer.AbstractXStreamSerializer |
---|
addAlias, addFieldAlias, addPackageAlias, canSerializeTo, classForType, convert, deserialize, getCharset, getConverterFactory, getXStream, serialize, typeForClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBObjectXStreamSerializer()
AnnotationRevisionResolver
is used to resolve revision for serialized
objects.
public DBObjectXStreamSerializer(com.thoughtworks.xstream.XStream xStream)
AnnotationRevisionResolver
is used to resolve the revision for
serialized objects.
xStream
- XStream instance to usepublic DBObjectXStreamSerializer(com.thoughtworks.xstream.XStream xStream, RevisionResolver revisionResolver)
revisionResolver
is used to resolve the revision of the
serialized object.
xStream
- The XStream instance to serialize objects withrevisionResolver
- The instance to resolve revisions withpublic DBObjectXStreamSerializer(Charset charset)
charset
. A default XStream instance (with XppDriver
) is used to perform the serialization.
An AnnotationRevisionResolver
is used to resolve the revision for
serialized objects.
charset
- The character set to usepublic DBObjectXStreamSerializer(Charset charset, com.thoughtworks.xstream.XStream xStream)
charset
and xStream
instance. The
xStream
instance is configured with several converters for the most common types in Axon.
An AnnotationRevisionResolver
is used to resolve the revision for
serialized objects.
charset
- The character set to usexStream
- The XStream instance to usepublic DBObjectXStreamSerializer(Charset charset, com.thoughtworks.xstream.XStream xStream, RevisionResolver revisionResolver)
charset
, xStream
and
revisionResolver
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 instance to resolve revisions withpublic DBObjectXStreamSerializer(Charset charset, com.thoughtworks.xstream.XStream xStream, RevisionResolver revisionResolver, ConverterFactory converterFactory)
charset
and xStream
instance. The
given converterFactory
instance is used to convert between serialized representation types.
charset
- The character set to usexStream
- The XStream instance to userevisionResolver
- The strategy to use to resolve the revision of an objectconverterFactory
- The converter factory to provide the convertersMethod Detail |
---|
protected void registerConverters(ChainingConverterFactory converterFactory)
AbstractXStreamSerializer
registerConverters
in class AbstractXStreamSerializer
converterFactory
- the ConverterFactory to register the converters withprotected <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(Class, Class, Object)
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 with
protected 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 with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |