org.axonframework.serializer
Interface ConverterFactory

All Known Implementing Classes:
ChainingConverterFactory

public interface ConverterFactory

Interface describing a mechanism that provides instances of ContentTypeConverter for a given source and target data type.

Since:
2.0
Author:
Allard Buijze

Method Summary
<S,T> ContentTypeConverter<S,T>
getConverter(Class<S> sourceContentType, Class<T> targetContentType)
          Returns a converter that is capable of converting IntermediateRepresentation object containing the given sourceContentType to the given targetContentType.
<S,T> boolean
hasConverter(Class<S> sourceContentType, Class<T> targetContentType)
          Indicates whether this factory contains a converter capable of converting the given sourceContentType into the targetContentType.
 

Method Detail

hasConverter

<S,T> boolean hasConverter(Class<S> sourceContentType,
                           Class<T> targetContentType)
Indicates whether this factory contains a converter capable of converting the given sourceContentType into the targetContentType.

Type Parameters:
S - The type of source data for which a converter must be available
T - The type of target data for which a converter must be available
Parameters:
sourceContentType - The type of source data for which a converter must be available
targetContentType - The type of target data for which a converter must be available
Returns:
true if a converter is available, otherwise false.

getConverter

<S,T> ContentTypeConverter<S,T> getConverter(Class<S> sourceContentType,
                                             Class<T> targetContentType)
Returns a converter that is capable of converting IntermediateRepresentation object containing the given sourceContentType to the given targetContentType.

Type Parameters:
S - The source content type
T - The target content type
Parameters:
sourceContentType - The type of data the converter accepts as input
targetContentType - The type of data the converter produces
Returns:
a converter capable of converting from the given sourceContentType to targetContentType
Throws:
CannotConvertBetweenTypesException - when no suitable converter can be found


Copyright © 2010-2016. All Rights Reserved.