-
- 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.
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ws/rs/ext/readerinterceptorcontext.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.