Class EndpointAccessContext

    • Constructor Detail

      • EndpointAccessContext

        public EndpointAccessContext​(Method endpointMethod,
                                     javax.servlet.http.HttpServletRequest request)
        Creates a new EndpointAccessContext.
        Parameters:
        endpointMethod - the endpoint method to be checked for access
        request - the HTTP request trying to access the endpoint
    • Method Detail

      • getEndpointMethod

        public Method getEndpointMethod()
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
      • findAnnotation

        public <A extends AnnotationOptional<A> findAnnotation​(Class<A> annotationType)
        Description copied from interface: AccessContext
        A convenience method that allows to find the first matching annotation of a certain type, looking in locations and in an order that makes the most sense for the target type of this access context. This method does support meta-annotations.
        Specified by:
        findAnnotation in interface AccessContext
        Type Parameters:
        A - the annotation type
        Parameters:
        annotationType - the annotation type
        Returns:
        the first matching annotation
      • findAnnotation

        public static <A extends AnnotationOptional<A> findAnnotation​(Method endpointMethod,
                                                                        Class<A> annotationType)
        Tries to find the first matching annotation of the given type on the endpoint method. If none is found, the endpoint class is examined. This method also examines superclasses and interfaces and supports meta-annotations.
        Type Parameters:
        A - the annotation type
        Parameters:
        endpointMethod - the endpoint method
        annotationType - the annotation type being looked for
        Returns:
        the first matching annotation