Class AbstractReaderInterceptorContext
java.lang.Object
org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext
- All Implemented Interfaces:
InterceptorContext,ReaderInterceptorContext
- Direct Known Subclasses:
ClientReaderInterceptorContext,ServerReaderInterceptorContext
public abstract class AbstractReaderInterceptorContext
extends Object
implements ReaderInterceptorContext
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Annotation[]protected Typeprotected MultivaluedMap<String,String> protected intprotected InputStreamprotected ReaderInterceptor[]protected MediaTypeprotected ResteasyProviderFactoryprotected RESTEasyTracingLoggerprotected Class -
Constructor Summary
ConstructorsConstructorDescriptionAbstractReaderInterceptorContext(MediaType mediaType, ResteasyProviderFactory providerFactory, Annotation[] annotations, ReaderInterceptor[] interceptors, MultivaluedMap<String, String> headers, Type genericType, Class type, InputStream inputStream) Deprecated.AbstractReaderInterceptorContext(MediaType mediaType, ResteasyProviderFactory providerFactory, Annotation[] annotations, ReaderInterceptor[] interceptors, MultivaluedMap<String, String> headers, Type genericType, Class type, InputStream inputStream, RESTEasyTracingLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionGet an array of the annotations formally declared on the artifact that initiated the intercepted entity provider invocation.Get the type of the object to be produced or written.Get mutable map of HTTP headers.Get the input stream of the object to be read.Get media type of HTTP entity.protected MessageBodyReadergetType()Get Java type supported by corresponding message body provider.proceed()Proceed to the next interceptor in the chain.protected ObjectreadFrom(MessageBodyReader reader) protected abstract MessageBodyReaderresolveReader(MediaType mediaType) voidsetAnnotations(Annotation[] annotations) Update annotations on the formal declaration of the artifact that initiated the intercepted entity provider invocation.voidsetGenericType(Type genericType) Update type of the object to be produced or written.voidSet the input stream of the object to be read.voidsetMediaType(MediaType mediaType) Update media type of HTTP entity.voidUpdate Java type before calling message body provider.protected abstract voidprotected final voidtraceAfter(ReaderInterceptor interceptor) protected final voidtraceBefore(ReaderInterceptor interceptor) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.ws.rs.ext.InterceptorContext
getProperty, getPropertyNames, hasProperty, removeProperty, setProperty
-
Field Details
-
tracingLogger
-
interceptors
-
providerFactory
-
type
-
genericType
-
annotations
-
mediaType
-
headers
-
inputStream
-
index
protected int index
-
-
Constructor Details
-
AbstractReaderInterceptorContext
@Deprecated public AbstractReaderInterceptorContext(MediaType mediaType, ResteasyProviderFactory providerFactory, Annotation[] annotations, ReaderInterceptor[] interceptors, MultivaluedMap<String, String> headers, Type genericType, Class type, InputStream inputStream) Deprecated. -
AbstractReaderInterceptorContext
public AbstractReaderInterceptorContext(MediaType mediaType, ResteasyProviderFactory providerFactory, Annotation[] annotations, ReaderInterceptor[] interceptors, MultivaluedMap<String, String> headers, Type genericType, Class type, InputStream inputStream, RESTEasyTracingLogger logger)
-
-
Method Details
-
proceed
Description copied from interface:ReaderInterceptorContextProceed to the next interceptor in the chain. Return the result of the next interceptor invoked. 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 wrappedMessageBodyReader.readFrom(java.lang.Class<T>, java.lang.reflect.Type, java.lang.annotation.Annotation[], jakarta.ws.rs.core.MediaType, jakarta.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.String>, java.io.InputStream).- Specified by:
proceedin interfaceReaderInterceptorContext- Returns:
- result of next interceptor invoked.
- Throws:
IOException- if an IO error arises or is thrown by the wrappedMessageBodyReader.readFrommethod.
-
readFrom
- Throws:
IOException
-
traceBefore
-
traceAfter
-
getReader
-
resolveReader
-
throwReaderNotFound
protected abstract void throwReaderNotFound() -
getInputStream
Description copied from interface:ReaderInterceptorContextGet the input stream of the object to be read. The JAX-RS runtime is responsible for closing the input stream.- Specified by:
getInputStreamin interfaceReaderInterceptorContext- Returns:
- input stream of the object to be read.
-
setInputStream
Description copied from interface:ReaderInterceptorContextSet the input stream of the object to be read. For example, by wrapping it with another input stream. The JAX-RS runtime is responsible for closing the input stream that is set.- Specified by:
setInputStreamin interfaceReaderInterceptorContext- Parameters:
is- new input stream.
-
getHeaders
Description copied from interface:ReaderInterceptorContextGet mutable map of HTTP headers.Note that while the headers are mutable, a
reader interceptorshould typically roll-back any header modifications once the call tocontext.proceed()returns, to avoid externally visible side-effects of the interceptor invocation.- Specified by:
getHeadersin interfaceReaderInterceptorContext- Returns:
- map of HTTP headers.
-
getAnnotations
Description copied from interface:InterceptorContextGet an array of the annotations formally declared on the artifact that initiated the intercepted entity provider invocation. E.g. if the message body is to be converted into a method parameter, this will be the annotations on that parameter returned byMethod.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 byMethod.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 returnnull.- Specified by:
getAnnotationsin interfaceInterceptorContext- Returns:
- annotations declared on the artifact that initiated the intercepted entity provider invocation.
-
setAnnotations
Description copied from interface:InterceptorContextUpdate annotations on the formal declaration of the artifact that initiated the intercepted entity provider invocation. Calling this method has no effect in the client API.- Specified by:
setAnnotationsin interfaceInterceptorContext- Parameters:
annotations- updated annotations declarataion of the artifact that initiated the intercepted entity provider invocation. Must not benull.
-
getType
Description copied from interface:InterceptorContextGet Java type supported by corresponding message body provider.- Specified by:
getTypein interfaceInterceptorContext- Returns:
- java type supported by provider
-
setType
Description copied from interface:InterceptorContextUpdate Java type before calling message body provider.- Specified by:
setTypein interfaceInterceptorContext- Parameters:
type- java type for provider
-
getGenericType
Description copied from interface:InterceptorContextGet the type of the object to be produced or written.- Specified by:
getGenericTypein interfaceInterceptorContext- Returns:
- type of object produced or written
-
setGenericType
Description copied from interface:InterceptorContextUpdate type of the object to be produced or written.- Specified by:
setGenericTypein interfaceInterceptorContext- Parameters:
genericType- new type for object
-
getMediaType
Description copied from interface:InterceptorContextGet media type of HTTP entity.- Specified by:
getMediaTypein interfaceInterceptorContext- Returns:
- media type of HTTP entity
-
setMediaType
Description copied from interface:InterceptorContextUpdate media type of HTTP entity.- Specified by:
setMediaTypein interfaceInterceptorContext- Parameters:
mediaType- new type for HTTP entity
-
getProcessedInterceptorCount
-