public abstract class AbstractReaderInterceptorContext extends Object implements ReaderInterceptorContext
| Modifier and Type | Field and Description |
|---|---|
protected Annotation[] |
annotations |
protected Type |
genericType |
protected MultivaluedMap<String,String> |
headers |
protected int |
index |
protected InputStream |
inputStream |
protected ReaderInterceptor[] |
interceptors |
protected MediaType |
mediaType |
protected ResteasyProviderFactory |
providerFactory |
protected Class |
type |
| Constructor and Description |
|---|
AbstractReaderInterceptorContext(MediaType mediaType,
ResteasyProviderFactory providerFactory,
Annotation[] annotations,
ReaderInterceptor[] interceptors,
MultivaluedMap<String,String> headers,
Type genericType,
Class type,
InputStream inputStream) |
| Modifier and Type | Method and Description |
|---|---|
Annotation[] |
getAnnotations()
Get an array of the annotations formally declared on the artifact that
initiated the intercepted entity provider invocation.
|
Type |
getGenericType()
Get the type of the object to be produced or written.
|
MultivaluedMap<String,String> |
getHeaders()
Get mutable map of HTTP headers.
|
InputStream |
getInputStream()
Get the input stream of the object to be read.
|
MediaType |
getMediaType()
Get media type of HTTP entity.
|
protected MessageBodyReader |
getReader() |
Class |
getType()
Get Java type supported by corresponding message body provider.
|
Object |
proceed()
Proceed to the next interceptor in the chain.
|
protected Object |
readFrom(MessageBodyReader reader) |
protected abstract MessageBodyReader |
resolveReader(MediaType mediaType) |
void |
setAnnotations(Annotation[] annotations)
Update annotations on the formal declaration of the artifact that
initiated the intercepted entity provider invocation.
|
void |
setGenericType(Type genericType)
Update type of the object to be produced or written.
|
void |
setInputStream(InputStream is)
Set the input stream of the object to be read.
|
void |
setMediaType(MediaType mediaType)
Update media type of HTTP entity.
|
void |
setType(Class type)
Update Java type before calling message body provider.
|
protected abstract void |
throwReaderNotFound() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProperty, getPropertyNames, removeProperty, setPropertyprotected ReaderInterceptor[] interceptors
protected ResteasyProviderFactory providerFactory
protected Class type
protected Type genericType
protected Annotation[] annotations
protected MediaType mediaType
protected MultivaluedMap<String,String> headers
protected InputStream inputStream
protected int index
public AbstractReaderInterceptorContext(MediaType mediaType, ResteasyProviderFactory providerFactory, Annotation[] annotations, ReaderInterceptor[] interceptors, MultivaluedMap<String,String> headers, Type genericType, Class type, InputStream inputStream)
public Object proceed() throws IOException
ReaderInterceptorContextMessageBodyReader.readFrom(java.lang.Class<T>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.String>, java.io.InputStream).proceed in interface ReaderInterceptorContextIOException - if an IO error arises or is
thrown by the wrapped MessageBodyReader.readFrom method.protected Object readFrom(MessageBodyReader reader) throws IOException
IOExceptionprotected MessageBodyReader getReader()
protected abstract MessageBodyReader resolveReader(MediaType mediaType)
protected abstract void throwReaderNotFound()
public InputStream getInputStream()
ReaderInterceptorContextgetInputStream in interface ReaderInterceptorContextpublic void setInputStream(InputStream is)
ReaderInterceptorContextsetInputStream in interface ReaderInterceptorContextis - new input stream.public MultivaluedMap<String,String> getHeaders()
ReaderInterceptorContext
Note that while the headers are mutable, a reader interceptor
should typically roll-back any header modifications once the call to context.proceed() returns, to avoid externally visible side-effects of the interceptor
invocation.
getHeaders in interface ReaderInterceptorContextpublic Annotation[] getAnnotations()
InterceptorContextMethod.getParameterAnnotations();
if the server-side response entity instance is to be converted into an
output stream, this will be the annotations on the matched resource method
returned by Method.getAnnotations().
This method may return an empty array in case the interceptor is
not invoked in a context of any particular resource method
(e.g. as part of the client API), but will never return null.getAnnotations in interface InterceptorContextpublic void setAnnotations(Annotation[] annotations)
InterceptorContextsetAnnotations in interface InterceptorContextannotations - updated annotations declarataion of the artifact that
initiated the intercepted entity provider invocation.
Must not be null.public Class getType()
InterceptorContextgetType in interface InterceptorContextpublic void setType(Class type)
InterceptorContextsetType in interface InterceptorContexttype - java type for providerpublic Type getGenericType()
InterceptorContextgetGenericType in interface InterceptorContextpublic void setGenericType(Type genericType)
InterceptorContextsetGenericType in interface InterceptorContextgenericType - new type for objectpublic MediaType getMediaType()
InterceptorContextgetMediaType in interface InterceptorContextpublic void setMediaType(MediaType mediaType)
InterceptorContextsetMediaType in interface InterceptorContextmediaType - new type for HTTP entityCopyright © 2014. All Rights Reserved.