Interface ContentTypeHandler

All Known Implementing Classes:
AbstractContentTypeHandler, FormUrlEncodedHandler, HtmlHandler, JacksonJsonHandler, JacksonXmlHandler, JuneauXmlHandler, MultipartFormDataHandler, XStreamHandler

public interface ContentTypeHandler
Handles transferring content to and from objects for a specific content type
  • Method Details

    • toObject

      @Deprecated void toObject(Reader in, Object target) throws IOException
      Deprecated.
      use version which requires ActionInvocation
      Populates an object using data from the input stream
      Parameters:
      in - The input stream, usually the body of the request
      target - The target, usually the action class
      Throws:
      IOException - If unable to write to the output stream
    • toObject

      void toObject(ActionInvocation invocation, Reader in, Object target) throws IOException
      Throws:
      IOException
    • fromObject

      @Deprecated String fromObject(Object obj, String resultCode, Writer stream) throws IOException
      Deprecated.
      use version which requires ActionInvocation
      Writes content to the stream
      Parameters:
      obj - The object to write to the stream, usually the Action class
      resultCode - The original result code
      stream - The output stream, usually the response
      Returns:
      The new result code
      Throws:
      IOException - If unable to write to the output stream
    • fromObject

      String fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer stream) throws IOException
      Throws:
      IOException
    • getContentType

      String getContentType()
      Gets the content type for this handler
      Returns:
      The mime type
    • getExtension

      String getExtension()
      Gets the extension this handler supports
      Returns:
      The extension