|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.upcasting.AbstractUpcasterChain
public abstract class AbstractUpcasterChain
Abstract implementation of the UpcasterChain interface. This implementation takes care of the iterative process and provides utility functions to convert content types.
Constructor Summary | |
---|---|
protected |
AbstractUpcasterChain(ConverterFactory converterFactory,
List<Upcaster> upcasters)
Initializes the UpcasterChain with given converterFactory and upcasters . |
protected |
AbstractUpcasterChain(List<Upcaster> upcasters)
Initializes the UpcasterChain with given upcasters and a ChainingConverterFactory to
convert between content types. |
Method Summary | ||
---|---|---|
protected abstract
|
doUpcast(Upcaster<T> upcaster,
SerializedObject<?> sourceObject,
List<SerializedType> targetTypes,
UpcastingContext context)
Performs the actual upcasting by the given upcaster on the given sourceObject . |
|
protected
|
ensureCorrectContentType(SerializedObject<S> serializedObject,
Class<T> expectedContentType)
Converts, if necessary, the given serializedObject , and returns a SerializedObject with given
expectedContentType . |
|
List<SerializedObject> |
upcast(SerializedObject serializedObject,
UpcastingContext upcastingContext)
Pass the given serializedObject through the chain of upcasters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractUpcasterChain(List<Upcaster> upcasters)
upcasters
and a ChainingConverterFactory
to
convert between content types.
upcasters
- the upcasters to form the chainprotected AbstractUpcasterChain(ConverterFactory converterFactory, List<Upcaster> upcasters)
converterFactory
and upcasters
.
converterFactory
- The factory providing the converters to convert between content typesupcasters
- The upcasters to form this chainMethod Detail |
---|
public List<SerializedObject> upcast(SerializedObject serializedObject, UpcastingContext upcastingContext)
UpcasterChain
serializedObject
through the chain of upcasters. The result is a list of zero or
more serializedObjects representing the latest revision of the payload object.
upcast
in interface UpcasterChain
serializedObject
- the serialized object to upcastupcastingContext
- the container of properties of the Message transporting the object being upcast
protected <S,T> SerializedObject<T> ensureCorrectContentType(SerializedObject<S> serializedObject, Class<T> expectedContentType)
serializedObject
, and returns a SerializedObject with given
expectedContentType
. If the serializedObject
already contains the given
expectedContentType
, it is returned as-is.
S
- The content type of the provided SerializedObjectT
- The content type of the SerializedObject to returnserializedObject
- The object to convertexpectedContentType
- The content type of the SerializedObject to return
protected abstract <T> List<SerializedObject<?>> doUpcast(Upcaster<T> upcaster, SerializedObject<?> sourceObject, List<SerializedType> targetTypes, UpcastingContext context)
upcaster
on the given sourceObject
. The
returned list of serialized object must represent the upcast version of the given sourceObject
.
Each item in the returned List of SerializedObject must match the given list of targetTypes
. These
types are returned by the invocation of Upcaster.upcast(org.axonframework.serializer.SerializedType)
.
T
- The representation type expected by the upcasterupcaster
- The upcaster to perform the upcasting withsourceObject
- The SerializedObject to upcasttargetTypes
- The types expected in the returned List of SerializedObjectcontext
- The container of properties of the Domain Event Message being upcast
sourceObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |