public abstract static class AbstractXStreamSerializer.Builder extends Object
AbstractXStreamSerializer
.
The Charset
is defaulted to a Charset.forName(String)
using the UTF-8
character set, the
RevisionResolver
defaults to an AnnotationRevisionResolver
and the Converter
defaults to
a ChainingConverter
. The XStream
is a hard requirement and as such should be provided.
Upon instantiation, several defaults aliases are added to the XStream instance, for example for the
GenericDomainEventMessage
, the GenericCommandMessage
and the MetaData
objects among
others. Additionally, a MetaData Converter is registered too. Lastly, if the provided Converter instance
is of type ChainingConverter, then the AbstractXStreamSerializer.registerConverters(ChainingConverter)
function will be called. Depending on the AbstractXStreamSerializer, this will add a number of Converter
instances to the chain.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AbstractXStreamSerializer.Builder |
charset(Charset charset)
Sets the
Charset used for the in- and output streams required by XStream for the to and from
xml function calls. |
AbstractXStreamSerializer.Builder |
converter(Converter converter)
Sets the
Converter used as a converter factory providing converter instances utilized by upcasters
to convert between different content types. |
AbstractXStreamSerializer.Builder |
revisionResolver(RevisionResolver revisionResolver)
Sets the
RevisionResolver used to resolve the revision from an object to be serialized. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
AbstractXStreamSerializer.Builder |
xStream(com.thoughtworks.xstream.XStream xStream)
Sets the
XStream used to perform the serialization of objects to XML, and vice versa. |
public AbstractXStreamSerializer.Builder xStream(com.thoughtworks.xstream.XStream xStream)
XStream
used to perform the serialization of objects to XML, and vice versa.xStream
- the XStream
used to perform the serialization of objects to XML, and vice versapublic AbstractXStreamSerializer.Builder charset(Charset charset)
Charset
used for the in- and output streams required by XStream
for the to and from
xml function calls. Defaults to a Charset.forName(String)
using the UTF-8
character set.charset
- the Charset
used for the in- and output streams required by XStream
public AbstractXStreamSerializer.Builder revisionResolver(RevisionResolver revisionResolver)
RevisionResolver
used to resolve the revision from an object to be serialized. Defaults to
an AnnotationRevisionResolver
which resolves the revision based on the contents of the
Revision
annotation on the serialized classes.revisionResolver
- a RevisionResolver
used to resolve the revision from an object to be
serializedpublic AbstractXStreamSerializer.Builder converter(Converter converter)
Converter
used as a converter factory providing converter instances utilized by upcasters
to convert between different content types. Defaults to a ChainingConverter
.converter
- a Converter
used as a converter factory providing converter instances utilized by
upcasters to convert between different content typesprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2019. All rights reserved.