Class AbstractResponseAdapter

java.lang.Object
starfederation.datastar.adapters.response.AbstractResponseAdapter
All Implemented Interfaces:
ResponseAdapter

public abstract class AbstractResponseAdapter extends Object implements ResponseAdapter
  • Field Details

  • Constructor Details

    • AbstractResponseAdapter

      public AbstractResponseAdapter()
  • Method Details

    • getWriter

      public PrintWriter getWriter() throws Exception
      Description copied from interface: ResponseAdapter
      Provides a `PrintWriter` for writing content to the response.
      Specified by:
      getWriter in interface ResponseAdapter
      Returns:
      The `PrintWriter` for the response.
      Throws:
      Exception - if the writer cannot be retrieved.
    • setHeader

      public void setHeader(String name, String value)
      Description copied from interface: ResponseAdapter
      Sets a header on the response.
      Specified by:
      setHeader in interface ResponseAdapter
      Parameters:
      name - The name of the header.
      value - The value of the header.
    • setContentType

      public void setContentType(String contentType)
      Description copied from interface: ResponseAdapter
      Sets the content type of the response.
      Specified by:
      setContentType in interface ResponseAdapter
      Parameters:
      contentType - The MIME type of the response content.
    • setCharacterEncoding

      public void setCharacterEncoding(String encoding)
      Description copied from interface: ResponseAdapter
      Sets the character encoding for the response.
      Specified by:
      setCharacterEncoding in interface ResponseAdapter
      Parameters:
      encoding - The character encoding to use.
    • setStatus

      public void setStatus(int status)
      Description copied from interface: ResponseAdapter
      Sets the HTTP status code for the response.
      Specified by:
      setStatus in interface ResponseAdapter
      Parameters:
      status - The HTTP status code.