public interface WriterInterceptorContext extends InterceptorContext
WriterInterceptor
to intercept calls to
MessageBodyWriter.writeTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], jakarta.ws.rs.core.MediaType, jakarta.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, java.io.OutputStream)
. The getters and setters in this context class correspond to the
parameters of the intercepted method.WriterInterceptor
,
MessageBodyWriter
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getEntity()
Get object to be written as HTTP entity.
|
MultivaluedMap<java.lang.String,java.lang.Object> |
getHeaders()
Get mutable map of HTTP headers.
|
java.io.OutputStream |
getOutputStream()
Get the output stream for the object to be written.
|
void |
proceed()
Proceed to the next interceptor in the chain.
|
void |
setEntity(java.lang.Object entity)
Update object to be written as HTTP entity.
|
void |
setOutputStream(java.io.OutputStream os)
Set a new output stream for the object to be written.
|
getAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getType, hasProperty, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType
void proceed() throws java.io.IOException, WebApplicationException
MessageBodyWriter.writeTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], jakarta.ws.rs.core.MediaType, jakarta.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, java.io.OutputStream)
method.java.io.IOException
- if an IO error arises or is thrown by the wrapped MessageBodyWriter.writeTo
method.WebApplicationException
- thrown by the wrapped MessageBodyWriter.writeTo
method.java.lang.Object getEntity()
void setEntity(java.lang.Object entity)
entity
- new object to be written.java.io.OutputStream getOutputStream()
void setOutputStream(java.io.OutputStream os)
os
- new output stream for the object to be written.MultivaluedMap<java.lang.String,java.lang.Object> getHeaders()