|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.eventstore.XStreamEventSerializer
public class XStreamEventSerializer
Implementation of the serializer that uses XStream as underlying serialization mechanism. Events are serialized to XML.
| Constructor Summary | |
|---|---|
XStreamEventSerializer()
Initialize an EventSerializer that uses XStream to serialize Events. |
|
XStreamEventSerializer(Charset charset)
Initialize an EventSerializer that uses XStream to serialize Events. |
|
XStreamEventSerializer(String charsetName)
Initialize an EventSerializer that uses XStream to serialize Events. |
|
| Method Summary | |
|---|---|
void |
addAlias(String name,
Class type)
Adds an alias to use instead of the fully qualified class name. |
void |
addFieldAlias(String alias,
Class definedIn,
String fieldName)
Adds an alias to use for a given field in the given class. |
void |
addPackageAlias(String alias,
String pkgName)
Add an alias for a package. |
DomainEvent |
deserialize(byte[] serializedEvent)
Deserialize a DomainEvent using the given serializedEvents. |
com.thoughtworks.xstream.XStream |
getXStream()
Returns a reference to the underlying XStream instance, that does the actual
serialization. |
byte[] |
serialize(DomainEvent event)
Serialize the given events into a byte[]. |
void |
setEventUpcasters(List<EventUpcaster<org.dom4j.Document>> eventUpcasters)
Sets the event upcasters the serializer may use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XStreamEventSerializer()
public XStreamEventSerializer(String charsetName)
charsetName - The name of the character set to use.public XStreamEventSerializer(Charset charset)
charset - The character set to use.| Method Detail |
|---|
public byte[] serialize(DomainEvent event)
events into a byte[]. The actual encoding used depends on the implementation.
serialize in interface EventSerializerevent - The event to serialize
public DomainEvent deserialize(byte[] serializedEvent)
serializedEvents. Implementations are *not* allowed to
change the given serializedEvent (byte array).
deserialize in interface EventSerializerserializedEvent - The byte array containing the serialized domain event.
public void addAlias(String name,
Class type)
name - The alias to usetype - The Class to use the alias forXStream.alias(String, Class)
public void addPackageAlias(String alias,
String pkgName)
alias - The alias to use.pkgName - The package to use the alias forXStream.aliasPackage(String, String)
public void addFieldAlias(String alias,
Class definedIn,
String fieldName)
alias - The alias to use instead of the original field namedefinedIn - The class that defines the field.fieldName - The name of the field to use the alias forXStream.aliasField(String, Class, String)public com.thoughtworks.xstream.XStream getXStream()
XStream instance, that does the actual
serialization.
XStreampublic void setEventUpcasters(List<EventUpcaster<org.dom4j.Document>> eventUpcasters)
EventUpcaster<Document>.
eventUpcasters - The upcasters to assign to this serializer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||