-
- All Superinterfaces:
- InterceptorContext
public interface ReaderInterceptorContext extends InterceptorContext
Context class used byReaderInterceptor
to intercept calls to (@link javax.ws.rs.ext.MessageBodyReader#readFrom}. 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:
ReaderInterceptor
,MessageBodyReader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description MultivaluedMap<String,String>
getHeaders()
Get mutable map of HTTP headers.InputStream
getInputStream()
Get the input stream of the object to be read.Object
proceed()
Proceed to the next interceptor in the chain.void
setInputStream(InputStream is)
Set the input stream of the object to be read.-
Methods inherited from interface javax.ws.rs.ext.InterceptorContext
getAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getType, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType
-
-
-
-
Method Detail
-
proceed
Object proceed() throws IOException, WebApplicationException
Proceed 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[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.String>, java.io.InputStream)
.- Returns:
- result of next interceptor invoked.
- Throws:
IOException
- if an IO error arises or is thrown by the wrappedMessageBodyReader.readFrom
method.WebApplicationException
- thrown by the wrappedMessageBodyReader.readFrom
method.
-
getInputStream
InputStream getInputStream()
Get the input stream of the object to be read. The JAX-RS runtime is responsible for closing the input stream.- Returns:
- input stream of the object to be read.
-
setInputStream
void setInputStream(InputStream is)
Set 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.- Parameters:
is
- new input stream.
-
getHeaders
MultivaluedMap<String,String> getHeaders()
Get mutable map of HTTP headers.Note that while the headers are mutable, a
reader interceptor
should typically roll-back any header modifications once the call tocontext.proceed()
returns, to avoid externally visible side-effects of the interceptor invocation.- Returns:
- map of HTTP headers.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 19:06:16 Cette version de la page est en cache (à la date du 21/08/2025 19:06:16) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/ws/rs/ext/ReaderInterceptorContext.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.