public interface InvokedResource
Information about the current request - invoked resource information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic InvokedResource
create
(ContainerRequestContext context) Create a new invoked resource from Jersey container request context.Resource definition class.Method that defines the invoked resource method.<T extends Annotation>
Optional<T> findAnnotation
(Class<T> annotationClass) Find the annotation by class closest to the handling method.<T extends Annotation>
Optional<T> findClassAnnotation
(Class<T> annotationClass) Find class annotation by class closest to the handling class.<T extends Annotation>
Optional<T> findMethodAnnotation
(Class<T> annotationClass) Find method annotation by class closest to the handling method.Resource handling class.Method that handles the invoked resource method.
-
Method Details
-
create
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
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
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
Resource definition class. The definition class is the class annotated withPath
annotation.- Returns:
- class of the JAX-RS resource or empty if none found
-
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
Find the annotation by class closest to the handling method.Search order:
handlingMethod()
- All methods from super classes up to
definitionMethod()
handlingClass()
- All super classes of the
handlingClass()
- 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
Find method annotation by class closest to the handling method.Search order:
handlingMethod()
- 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
Find class annotation by class closest to the handling class.Search order:
handlingClass()
- All super classes of the
handlingClass()
- 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
-