Package io.helidon.jersey.common
Interface InvokedResource
-
public interface InvokedResource
Information about the current request - invoked resource information.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static InvokedResource
create(ContainerRequestContext context)
Create a new invoked resource from Jersey container request context.Optional<Class<?>>
definitionClass()
Resource definition class.Optional<Method>
definitionMethod()
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.Optional<Class<?>>
handlingClass()
Resource handling class.Optional<Method>
handlingMethod()
Method that handles the invoked resource method.
-
-
-
Method Detail
-
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 withPath
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:
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
<T extends Annotation> Optional<T> findMethodAnnotation(Class<T> annotationClass)
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
<T extends Annotation> Optional<T> findClassAnnotation(Class<T> annotationClass)
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
-
-