javax.ws.rs.ext
Interface WriterInterceptorContext<T>

Type Parameters:
T - Java type supported by corresponding message body writer
All Superinterfaces:
InterceptorContext<T>

public interface WriterInterceptorContext<T>
extends InterceptorContext<T>

Context class used by WriterInterceptor to intercept calls to MessageBodyWriter.writeTo(T, java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, 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 Summary
 T getEntity()
          Get object to be written as HTTP entity.
 MultivaluedMap<String,Object> getHeaders()
          Get mutable map of HTTP headers.
 OutputStream getOutputStream()
          Get the output stream for the object to be written.
 void proceed()
          Proceed to the next interceptor in the chain.
 void setEntity(T entity)
          Update object to be written as HTTP entity.
 void setOutputStream(OutputStream os)
          Update the output stream for the object to be written.
 
Methods inherited from interface javax.ws.rs.ext.InterceptorContext
getAnnotations, getGenericType, getMediaType, getProperties, getType, setAnnotations, setGenericType, setMediaType, setType
 

Method Detail

proceed

void proceed()
             throws IOException
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 MessageBodyWriter.writeTo(T, java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.OutputStream) method.

Throws:
IOException - if an IO exception arises.

getEntity

T getEntity()
Get object to be written as HTTP entity.

Returns:
object to be written as HTTP entity.

setEntity

void setEntity(T 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.

Returns:
output stream for the object to be written.

setOutputStream

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

Parameters:
os - new output stream for the object to be written.

getHeaders

MultivaluedMap<String,Object> getHeaders()
Get mutable map of HTTP headers.

Returns:
map of HTTP headers.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.