Interface MessageBodyHandlerRegistry

All Known Implementing Classes:
ContextlessMessageBodyHandlerRegistry, DefaultMessageBodyHandlerRegistry

public interface MessageBodyHandlerRegistry
Since:
4.0.0
  • Field Details

  • Method Details

    • findReader

      <T> Optional<MessageBodyReader<T>> findReader(@NonNull @NonNull io.micronaut.core.type.Argument<T> type, @Nullable @Nullable List<MediaType> mediaType)
      Find a reader for the type and annotation metadata at declaration point.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      mediaType - The media type
      Returns:
      A message body reader if it is existing.
    • findReader

      default <T> Optional<MessageBodyReader<T>> findReader(@NonNull @NonNull io.micronaut.core.type.Argument<T> type, @NonNull @NonNull MediaType mediaType)
      Find a reader for the type and annotation metadata at declaration point.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      mediaType - The media type
      Returns:
      A message body reader if it is existing.
      Since:
      4.6
    • findReader

      default <T> Optional<MessageBodyReader<T>> findReader(@NonNull @NonNull io.micronaut.core.type.Argument<T> type)
      Find a reader for the type and annotation metadata at declaration point.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      Returns:
      A message body reader if it is existing.
      Since:
      4.6
    • findWriter

      <T> Optional<MessageBodyWriter<T>> findWriter(@NonNull @NonNull io.micronaut.core.type.Argument<T> type, @NonNull @NonNull List<MediaType> mediaType)
      Find a writer for the type and annotation metadata at declaration point.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      mediaType - The media type
      Returns:
      A message body writer if it is existing.
    • findWriter

      default <T> Optional<MessageBodyWriter<T>> findWriter(@NonNull @NonNull io.micronaut.core.type.Argument<T> type, @NonNull @NonNull MediaType mediaType)
      Find a writer for the type and annotation metadata at declaration point.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      mediaType - The media type
      Returns:
      A message body writer if it is existing.
      Since:
      4.6
    • findWriter

      default <T> Optional<MessageBodyWriter<T>> findWriter(@NonNull @NonNull io.micronaut.core.type.Argument<T> type)
      Find a writer for the type and annotation metadata at declaration point.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      Returns:
      A message body writer if it is existing.
      Since:
      4.6
    • getWriter

      default <T> MessageBodyWriter<T> getWriter(@NonNull @NonNull io.micronaut.core.type.Argument<T> type, @NonNull @NonNull List<MediaType> mediaType)
      Gets a writer for the type and annotation metadata at declaration point or fails with CodecException.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      mediaType - The media type
      Returns:
      A message body writer if it is existing.