|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The data format that this upcaster uses to represent the eventpublic interface Upcaster<T>
Interface for Upcasters. An upcaster is the mechanism used to convert deprecated (typically serialized) objects and convert them into the current format. If the serializer itself is not able to cope with the changed formats (XStream, for example, will allow for some changes by using aliases), the Upcaster will allow you to configure more complex structural transformations.
Upcasters work on intermediate representations of the object to upcast. In some cases, this representation is a byte array, while in other cases an object structure is used. The Serializer is responsible for converting the intermediate representation form to one that is compatible with the upcaster. For performance reasons, it is advisable to ensure that all upcasters in the same chain (where one's output is another's input) use the same intermediate representation type.
Method Summary | |
---|---|
boolean |
canUpcast(SerializedType serializedType)
Indicates whether this upcaster is capable of upcasting the given type . |
Class<T> |
expectedRepresentationType()
Returns the type of intermediate representation this upcaster expects. |
List<SerializedObject<?>> |
upcast(SerializedObject<T> intermediateRepresentation,
List<SerializedType> expectedTypes,
UpcastingContext context)
Upcasts the given intermediateRepresentation into zero or more other representations. |
List<SerializedType> |
upcast(SerializedType serializedType)
Upcast the given serializedType into its new format. |
Method Detail |
---|
boolean canUpcast(SerializedType serializedType)
type
. Unless this method returns
true
, the upcast(org.axonframework.serializer.SerializedType)
and upcast(org.axonframework.serializer.SerializedType)
methods should not be
invoked on this Upcaster instance.
serializedType
- The type under investigation
true
if this upcaster can upcast the given serialized type, false
otherwise.Class<T> expectedRepresentationType()
List<SerializedObject<?>> upcast(SerializedObject<T> intermediateRepresentation, List<SerializedType> expectedTypes, UpcastingContext context)
intermediateRepresentation
into zero or more other representations. The returned
list of Serialized Objects must match the given list of serialized types.
intermediateRepresentation
- The representation of the object to upcastexpectedTypes
- The expected types of the returned serialized objects.context
- An instance describing the context of the object to upcast
List<SerializedType> upcast(SerializedType serializedType)
serializedType
into its new format. Generally, this involves increasing the
revision. Sometimes, it is also necessary to alter the type's name (in case of a renamed class, for example).
The order and the size of the list returned has to match with the order and size of the list of the upcast
IntermediateRepresentations by this upcaster.
To base the type on the actual contents of the Serialized Object, implement the ExtendedUpcaster
interface instead.
serializedType
- The serialized type to upcast
ExtendedUpcaster.upcast(org.axonframework.serializer.SerializedType,
org.axonframework.serializer.SerializedObject)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |