Top Description Methods
jakarta.ws.rs.ext

public Interface ContextResolver<T>

Type Parameters
<T>
type of the context

Contract for a provider that supplies context information to resource classes and other providers. A ContextResolver implementation may be annotated with jakarta.ws.rs.Produces to restrict the media types for which it will be considered suitable.

Providers implementing ContextResolver contract must be either programmatically registered in a JAX-RS runtime or must be annotated with @Provider annotation to be automatically discovered by the JAX-RS runtime during a provider scanning phase.

Authors
Paul Sandoz, Marc Hadley
Since
1.0
See Also
jakarta.ws.rs.core.Context, Providers#getContextResolver(Class, jakarta.ws.rs.core.MediaType), Provider, jakarta.ws.rs.Produces

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

a context for the supplied type or null if a context for the supplied type is not available from this provider.
getContext
(Class<?>
the class of object for which a context is desired
type
)

Get a context of type T that is applicable to the supplied type.

Method Detail

getContextback to summary
public T getContext(Class<?> type)

Get a context of type T that is applicable to the supplied type.

Parameters
type:Class<?>

the class of object for which a context is desired

Returns:T

a context for the supplied type or null if a context for the supplied type is not available from this provider.