public interface SerializerLocator
Modifier and Type | Method and Description |
---|---|
<T,D extends Serializer<? extends T>> |
findCustomSerializer(java.lang.Class<? extends D> serializerClass)
Gets a custom serializer.
|
<T> Serializer<? super T> |
findSerializer(io.micronaut.core.type.Argument<? extends T> forType)
Finds a serializer for the given type.
|
default <T> Serializer<? super T> |
findSerializer(java.lang.Class<? extends T> forType)
Finds a serializer for the given type.
|
@NonNull <T,D extends Serializer<? extends T>> D findCustomSerializer(@NonNull java.lang.Class<? extends D> serializerClass) throws SerdeException
T
- The generic typeD
- The serializer typeserializerClass
- The serializer class, should not be null
SerdeException
- if no serializer is found@NonNull <T> Serializer<? super T> findSerializer(@NonNull io.micronaut.core.type.Argument<? extends T> forType) throws SerdeException
T
- The generic typeforType
- The typeSerdeException
- if an exception occurs@NonNull default <T> Serializer<? super T> findSerializer(@NonNull java.lang.Class<? extends T> forType) throws SerdeException
T
- The generic typeforType
- The typeSerdeException
- if an exception occurs