Interface InvokedResource


public interface InvokedResource
Information about the current request - invoked resource information.
  • Method Details

    • create

      static InvokedResource create(ContainerRequestContext context)
      Create a new invoked resource from Jersey container request context.
      Parameters:
      context - request context
      Returns:
      an instance of invoked resource to access information about resource class, method and annotations
    • definitionMethod

      Optional<Method> definitionMethod()
      Method that defines the invoked resource method. This may come from an interface.
      Returns:
      Method used to declared handling of the current request or empty if none found
    • handlingMethod

      Optional<Method> handlingMethod()
      Method that handles the invoked resource method. This must come from a class.
      Returns:
      Method used to handle current request or empty if none found
    • definitionClass

      Optional<Class<?>> definitionClass()
      Resource definition class. The definition class is the class annotated with Path annotation.
      Returns:
      class of the JAX-RS resource or empty if none found
    • handlingClass

      Optional<Class<?>> handlingClass()
      Resource handling class. The handling class is the class that declares the handling method.
      Returns:
      class of the JAX-RS resource implementation or empty if none found
    • findAnnotation

      <T extends Annotation> Optional<T> findAnnotation(Class<T> annotationClass)
      Find the annotation by class closest to the handling method.

      Search order:

      1. handlingMethod()
      2. All methods from super classes up to definitionMethod()
      3. handlingClass()
      4. All super classes of the handlingClass()
      5. All implemented interfaces
      Type Parameters:
      T - type of the annotation
      Parameters:
      annotationClass - class of the annotation to find
      Returns:
      first annotation found, or empty if not declared
    • findMethodAnnotation

      <T extends Annotation> Optional<T> findMethodAnnotation(Class<T> annotationClass)
      Find method annotation by class closest to the handling method.

      Search order:

      1. handlingMethod()
      2. All methods from super classes up to definitionMethod()
      Type Parameters:
      T - type of the annotation
      Parameters:
      annotationClass - class of the annotation to find
      Returns:
      first annotation found, or empty if not declared on a method
    • findClassAnnotation

      <T extends Annotation> Optional<T> findClassAnnotation(Class<T> annotationClass)
      Find class annotation by class closest to the handling class.

      Search order:

      1. handlingClass()
      2. All super classes of the handlingClass()
      3. All implemented interfaces
      Type Parameters:
      T - type of the annotation
      Parameters:
      annotationClass - class of the annotation to find
      Returns:
      first annotation found, or empty if not declared on a class