Top Description Methods
javax.ws.rs.ext

public Interface WriterInterceptorContext

extends InterceptorContext
Imports
java.io.IOException, .OutputStream, javax.ws.rs.WebApplicationException, javax.ws.rs.core.MultivaluedMap

Context class used by javax.ws.rs.ext.WriterInterceptor to intercept calls to javax.ws.rs.ext.MessageBodyWriter#writeTo. The getters and setters in this context class correspond to the parameters of the intercepted method.
Authors
Santiago Pericas-Geertsen, Bill Burke
Since
2.0
See Also
WriterInterceptor, MessageBodyWriter

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

object to be written as HTTP entity.
getEntity
()

Get object to be written as HTTP entity.

public MultivaluedMap<String, Object>

Returns:

map of HTTP headers.
getHeaders
()

Get mutable map of HTTP headers.

public OutputStream

Returns:

output stream for the object to be written.
getOutputStream
()

Get the output stream for the object to be written.

public void
proceed()

Proceed to the next interceptor in the chain.

public void
setEntity(Object
new object to be written.
entity
)

Update object to be written as HTTP entity.

public void
setOutputStream(OutputStream
new output stream for the object to be written.
os
)

Set a new output stream for the object to be written.

Inherited from javax.ws.rs.ext.InterceptorContext:
getAnnotationsgetGenericTypegetMediaTypegetPropertygetPropertyNamesgetTyperemovePropertysetAnnotationssetGenericTypesetMediaTypesetPropertysetType

Method Detail

getEntityback to summary
public Object getEntity()

Get object to be written as HTTP entity.

Returns:Object

object to be written as HTTP entity.

getHeadersback to summary
public MultivaluedMap<String, Object> getHeaders()

Get mutable map of HTTP headers.

Returns:MultivaluedMap<String, Object>

map of HTTP headers.

getOutputStreamback to summary
public OutputStream getOutputStream()

Get the output stream for the object to be written. The JAX-RS runtime is responsible for closing the output stream.

Returns:OutputStream

output stream for the object to be written.

proceedback to summary
public 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 javax.ws.rs.ext.MessageBodyWriter#writeTo method.

Exceptions
IOException:
if an IO error arises or is thrown by the wrapped MessageBodyWriter.writeTo method.
WebApplicationException:
thrown by the wrapped MessageBodyWriter.writeTo method.
setEntityback to summary
public void setEntity(Object entity)

Update object to be written as HTTP entity.

Parameters
entity:Object

new object to be written.

setOutputStreamback to summary
public void setOutputStream(OutputStream os)

Set a new output stream for the object to be written. For example, by wrapping it with another output stream. The JAX-RS runtime is responsible for closing the output stream that is set.

Parameters
os:OutputStream

new output stream for the object to be written.