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 ContextResolverJAXBContext
was registered and then, say, ContextResolver.getContext(Foo.class) will be
called.
I think that in CXF if it were say CollectionFoo then a registered
ContextResolverJAXBContext, if any, would not be asked for a JAXBContext for
CollectionFoo 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 ContextResolverT {
/**
* Get a context of type codeT/code 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 codenull/code if a
* context for the supplied type is not available from this provider.
*/
T getContext(Class? type);
}