javax.ws.rs.ext
Interface ContextResolver<T>


public interface ContextResolver<T>

Contract for a provider that supplies context information to resource classes and other providers. An implementation of this interface must be annotated with Provider.

An injected instance of this interface will try each provider of the same generic type until one returns a non-null context.

See Also:
Context, Provider

Method Summary
 T getContext(java.lang.Class<?> type)
          Get a context of type T that is applicable to the supplied type.
 

Method Detail

getContext

T getContext(java.lang.Class<?> type)
Get a context of type T that is applicable to the supplied type.

Parameters:
type - the class of object for which a context is desired
Returns:
a context for the supplied type or null if a context for the supplied type is not available from this provider.


Copyright © 2008. All Rights Reserved.