Package jakarta.ws.rs.ext
Interface WriterInterceptorContext
- All Superinterfaces:
- InterceptorContext
public interface WriterInterceptorContext extends InterceptorContext
Context class used by 
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.- Since:
- 2.0
- Author:
- Santiago Pericas-Geertsen, Bill Burke
- See Also:
- WriterInterceptor,- MessageBodyWriter
- 
Method SummaryModifier and Type Method Description ObjectgetEntity()Get object to be written as HTTP entity.MultivaluedMap<String,Object>getHeaders()Get mutable map of HTTP headers.OutputStreamgetOutputStream()Get the output stream for the object to be written.voidproceed()Proceed to the next interceptor in the chain.voidsetEntity(Object entity)Update object to be written as HTTP entity.voidsetOutputStream(OutputStream os)Set a new output stream for the object to be written.Methods inherited from interface jakarta.ws.rs.ext.InterceptorContextgetAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getType, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType
- 
Method Details- 
proceedProceed 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 wrappedMessageBodyWriter.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.- Throws:
- IOException- if an IO error arises or is thrown by the wrapped- MessageBodyWriter.writeTomethod.
- WebApplicationException- thrown by the wrapped- MessageBodyWriter.writeTomethod.
 
- 
getEntityObject getEntity()Get object to be written as HTTP entity.- Returns:
- object to be written as HTTP entity.
 
- 
setEntityUpdate object to be written as HTTP entity.- Parameters:
- entity- new object to be written.
 
- 
getOutputStreamOutputStream 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.
 
- 
setOutputStreamSet 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- new output stream for the object to be written.
 
- 
getHeadersMultivaluedMap<String,Object> getHeaders()Get mutable map of HTTP headers.- Returns:
- map of HTTP headers.
 
 
-