Interface MediaSupport

All Superinterfaces:
NamedService
All Known Implementing Classes:
FormParamsSupport, JacksonSupport, JsonbSupport, JsonpSupport, MultiPartSupport, PathSupport, StringSupport

public interface MediaSupport extends NamedService
Media support to be registered with MediaContext.
  • Method Details

    • init

      default void init(MediaContext context)
      Once all providers are discovered/configured and context is established, the MediaContext calls this method on all providers to allow sub-resolution of readers and writers.
      Parameters:
      context - media context context
    • reader

      default <T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers headers)
      Reader for an entity.
      Type Parameters:
      T - type
      Parameters:
      type - type of entity
      headers - headers belonging to this entity (such as server request headers), expected to have content type
      Returns:
      reader response, whether this type is supported or not
    • writer

      default <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders)
      Server response writer.
      Type Parameters:
      T - type
      Parameters:
      type - type of entity
      requestHeaders - request headers
      responseHeaders - response headers
      Returns:
      writer response, whether this type is supported or not
    • reader

      default <T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers requestHeaders, Headers responseHeaders)
      Client response reader.
      Type Parameters:
      T - type
      Parameters:
      type - type of entity
      requestHeaders - request headers
      responseHeaders - response headers
      Returns:
      reader response, whether this type is supported or not
    • writer

      default <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, WritableHeaders<?> requestHeaders)
      Client request writer.
      Type Parameters:
      T - type
      Parameters:
      type - type of entity
      requestHeaders - request headers
      Returns:
      writer response, whether this type is supported or not