Interface DeserializerLocator

All Known Subinterfaces:
Deserializer.DecoderContext, SerdeRegistry
All Known Implementing Classes:
DefaultSerdeRegistry

public interface DeserializerLocator
Locator strategy interface for deserializers.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    <T, D extends Deserializer<? extends T>>
    D
    findCustomDeserializer(@NonNull Class<? extends D> deserializerClass)
    Gets a custom deserializer.
    <T> @NonNull Deserializer<? extends T>
    findDeserializer(@NonNull io.micronaut.core.type.Argument<? extends T> type)
    Finds a deserializer for the given type.
    default <T> @NonNull Deserializer<? extends T>
    findDeserializer(@NonNull Class<? extends T> type)
    Finds a deserializer for the given type.
    <T> Collection<io.micronaut.core.beans.BeanIntrospection<? extends T>>
    Locates desrializable subtypes for the given super type.
  • Method Details

    • findCustomDeserializer

      @NonNull <T, D extends Deserializer<? extends T>> D findCustomDeserializer(@NonNull @NonNull Class<? extends D> deserializerClass) throws SerdeException
      Gets a custom deserializer.
      Type Parameters:
      T - The generic type
      D - The deserializer type
      Parameters:
      deserializerClass - The deserializer class, should not be null
      Returns:
      The deserializer
      Throws:
      SerdeException - if no deserializer is found
    • findDeserializer

      @NonNull <T> @NonNull Deserializer<? extends T> findDeserializer(@NonNull @NonNull io.micronaut.core.type.Argument<? extends T> type) throws SerdeException
      Finds a deserializer for the given type.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type, should not be null
      Returns:
      The deserializer
      Throws:
      SerdeException - if no deserializer is found
    • findDeserializer

      @NonNull default <T> @NonNull Deserializer<? extends T> findDeserializer(@NonNull @NonNull Class<? extends T> type) throws SerdeException
      Finds a deserializer for the given type.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type, should not be null
      Returns:
      The deserializer
      Throws:
      SerdeException - if no deserializer is found
    • getDeserializableSubtypes

      <T> Collection<io.micronaut.core.beans.BeanIntrospection<? extends T>> getDeserializableSubtypes(Class<T> superType)
      Locates desrializable subtypes for the given super type.
      Type Parameters:
      T - The generic super type
      Parameters:
      superType - The super type
      Returns:
      The subtypes, never null