javax.ws.rs.ext

Interface InterceptorContext

    • Method Detail

      • getProperty

        Object getProperty(String name)
        Returns the property with the given name registered in the current request/response exchange context, or null if there is no property by that name.

        A property allows a JAX-RS filters and interceptors to exchange additional custom information not already provided by this interface.

        A list of supported properties can be retrieved using getPropertyNames(). Custom property names should follow the same convention as package names.

        In a Servlet container, on the server side, the properties are backed by the ServletRequest and contain all the attributes available in the ServletRequest.

        Parameters:
        name - a String specifying the name of the property.
        Returns:
        an Object containing the value of the property, or null if no property exists matching the given name.
        See Also:
        getPropertyNames()
      • getPropertyNames

        Collection<String> getPropertyNames()
        Returns an immutable collection containing the property names available within the context of the current request/response exchange context.

        Use the getProperty(java.lang.String) method with a property name to get the value of a property.

        In a Servlet container, the properties are synchronized with the ServletRequest and expose all the attributes available in the ServletRequest. Any modifications of the properties are also reflected in the set of properties of the associated ServletRequest.

        Returns:
        an immutable collection of property names.
        See Also:
        getProperty(java.lang.String)
      • setProperty

        void setProperty(String name,
                         Object object)
        Binds an object to a given property name in the current request/response exchange context. If the name specified is already used for a property, this method will replace the value of the property with the new value.

        A property allows a JAX-RS filters and interceptors to exchange additional custom information not already provided by this interface.

        A list of supported properties can be retrieved using getPropertyNames(). Custom property names should follow the same convention as package names.

        If a null value is passed, the effect is the same as calling the removeProperty(String) method.

        In a Servlet container, on the server side, the properties are backed by the ServletRequest and contain all the attributes available in the ServletRequest.

        Parameters:
        name - a String specifying the name of the property.
        object - an Object representing the property to be bound.
      • removeProperty

        void removeProperty(String name)
        Removes a property with the given name from the current request/response exchange context. After removal, subsequent calls to getProperty(java.lang.String) to retrieve the property value will return null.

        In a Servlet container, on the server side, the properties are backed by the ServletRequest and contain all the attributes available in the ServletRequest.

        Parameters:
        name - a String specifying the name of the property to be removed.
      • getAnnotations

        Annotation[] getAnnotations()
        Get 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 by Method.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.
        Returns:
        annotations declared on the artifact that initiated the intercepted entity provider invocation.
      • setAnnotations

        void setAnnotations(Annotation[] annotations)
        Update 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.
        Parameters:
        annotations - updated annotations declarataion of the artifact that initiated the intercepted entity provider invocation. Must not be null.
        Throws:
        NullPointerException - in case the input parameter is null.
      • getType

        Class<?> getType()
        Get Java type supported by corresponding message body provider.
        Returns:
        java type supported by provider
      • setType

        void setType(Class<?> type)
        Update Java type before calling message body provider.
        Parameters:
        type - java type for provider
      • getGenericType

        Type getGenericType()
        Get the type of the object to be produced or written.
        Returns:
        type of object produced or written
      • setGenericType

        void setGenericType(Type genericType)
        Update type of the object to be produced or written.
        Parameters:
        genericType - new type for object
      • getMediaType

        MediaType getMediaType()
        Get media type of HTTP entity.
        Returns:
        media type of HTTP entity
      • setMediaType

        void setMediaType(MediaType mediaType)
        Update media type of HTTP entity.
        Parameters:
        mediaType - new type for HTTP entity

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/ws/rs/ext/interceptorcontext.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.