Interface WriterInterceptorContext

All Superinterfaces:
InterceptorContext

public interface WriterInterceptorContext extends InterceptorContext
Context class used by WriterInterceptor to intercept calls to MessageBodyWriter.writeTo(T, Class, Type, Annotation[], MediaType, MultivaluedMap, OutputStream). The getters and setters in this context class correspond to the parameters of the intercepted method.
Since:
2.0
See Also:
  • Method Details

    • proceed

      void proceed() throws IOException, WebApplicationException
      Proceed to the next interceptor in the chain. Interceptors MUST explicitly call this method to continue the execution chain; the call to this method in the last interceptor of the chain will invoke the wrapped MessageBodyWriter.writeTo(T, Class, Type, Annotation[], MediaType, MultivaluedMap, OutputStream) method.
      Throws:
      IOException - if an IO error arises or is thrown by the wrapped MessageBodyWriter.writeTo method.
      WebApplicationException - thrown by the wrapped MessageBodyWriter.writeTo method.
    • getEntity

      Object getEntity()
      Get object to be written as HTTP entity.
      Returns:
      object to be written as HTTP entity.
    • setEntity

      void setEntity(Object entity)
      Update object to be written as HTTP entity.
      Parameters:
      entity - new object to be written.
    • getOutputStream

      OutputStream getOutputStream()
      Get the output stream for the object to be written. The JAX-RS runtime is responsible for closing the output stream.
      Returns:
      output stream for the object to be written.
    • setOutputStream

      void setOutputStream(OutputStream os)
      Update the output stream for the object to be written. The JAX-RS runtime is responsible for closing the output stream.
      Parameters:
      os - new output stream for the object to be written.
    • getHeaders

      Get mutable map of HTTP headers.
      Returns:
      map of HTTP headers.