Hi Benson
This interface is meant to be used with types like JAXBContext or (JAXB)
Marshaller, I think it was introduced to let users overcome the issues with the
existing JAXB releases, for some specific types be handled by custom context
providers. For ex, JAXB providers would check if ContextResolver
was registered and then, say, ContextResolver.getContext(Foo.class) will be
called.
I think that in CXF if it were say Collection then a registered
ContextResolver, if any, would not be asked for a JAXBContext for
Collection but for Foo only
cheers, Sergey
- Original Message -
From: Benson Margulies
To: Sergey Beryozkin ; CXF Dev
Sent: Tuesday, September 01, 2009 12:26 AM
Subject: Seeming JAX-RS mistake
This can't work right for generic types (like collections), since it doesn't
use java.lang.reflect.Type.
public interface ContextResolver {
/**
* Get a context of type T that is applicable to the supplied
* type.
* @param type the class of object for which a context is desired
* @return a context for the supplied type or null if a
* context for the supplied type is not available from this provider.
*/
T getContext(Class type);
}