Package javax.ws.rs.ext
Interface WriterInterceptorContext
-
- All Superinterfaces:
InterceptorContext
public interface WriterInterceptorContext extends InterceptorContext
Context class used byWriterInterceptorto intercept calls toMessageBodyWriter.writeTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.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
- See Also:
WriterInterceptor,MessageBodyWriter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetEntity()Get object to be written as HTTP entity.MultivaluedMap<java.lang.String,java.lang.Object>getHeaders()Get mutable map of HTTP headers.java.io.OutputStreamgetOutputStream()Get the output stream for the object to be written.voidproceed()Proceed to the next interceptor in the chain.voidsetEntity(java.lang.Object entity)Update object to be written as HTTP entity.voidsetOutputStream(java.io.OutputStream os)Update the output stream for the object to be written.-
Methods inherited from interface javax.ws.rs.ext.InterceptorContext
getAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getType, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType
-
-
-
-
Method Detail
-
proceed
void proceed() throws java.io.IOException, WebApplicationExceptionProceed 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[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, java.io.OutputStream)method.- Throws:
java.io.IOException- if an IO error arises or is thrown by the wrappedMessageBodyWriter.writeTomethod.WebApplicationException- thrown by the wrappedMessageBodyWriter.writeTomethod.
-
getEntity
java.lang.Object getEntity()
Get object to be written as HTTP entity.- Returns:
- object to be written as HTTP entity.
-
setEntity
void setEntity(java.lang.Object entity)
Update object to be written as HTTP entity.- Parameters:
entity- new object to be written.
-
getOutputStream
java.io.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(java.io.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
MultivaluedMap<java.lang.String,java.lang.Object> getHeaders()
Get mutable map of HTTP headers.- Returns:
- map of HTTP headers.
-
-