java.lang.Object
io.helidon.nima.http.media.jsonp.JsonpSupport
All Implemented Interfaces:
MediaSupport

public class JsonpSupport extends Object implements MediaSupport
Media support implementation for JSON Processing media support.
  • Field Details

    • JSON_OBJECT_TYPE

      public static final GenericType<JsonObject> JSON_OBJECT_TYPE
      Json object generic type.
    • JSON_ARRAY_TYPE

      public static final GenericType<JsonArray> JSON_ARRAY_TYPE
      Json array generic type.
  • Method Details

    • create

      public static MediaSupport create(Config config)
      Creates a new JsonpSupport.
      Parameters:
      config - must not be null
      Returns:
      a new JsonpSupport
    • serverResponseWriter

      public static <T extends JsonStructure> EntityWriter<T> serverResponseWriter()
      Server response writer direct access.
      Type Parameters:
      T - type to write
      Returns:
      a writer to write JSON-P objects
    • serverRequestReader

      public static <T extends JsonStructure> EntityReader<T> serverRequestReader()
      Server request reader direct access.
      Type Parameters:
      T - type to read
      Returns:
      a reader to read JSON-P objects
    • reader

      public <T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers requestHeaders)
      Description copied from interface: MediaSupport
      Reader for an entity.
      Specified by:
      reader in interface MediaSupport
      Type Parameters:
      T - type
      Parameters:
      type - type of entity
      requestHeaders - 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

      public <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders)
      Description copied from interface: MediaSupport
      Server response writer.
      Specified by:
      writer in interface MediaSupport
      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

      public <T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers requestHeaders, Headers responseHeaders)
      Description copied from interface: MediaSupport
      Client response reader.
      Specified by:
      reader in interface MediaSupport
      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

      public <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, WritableHeaders<?> requestHeaders)
      Description copied from interface: MediaSupport
      Client request writer.
      Specified by:
      writer in interface MediaSupport
      Type Parameters:
      T - type
      Parameters:
      type - type of entity
      requestHeaders - request headers
      Returns:
      writer response, whether this type is supported or not