public void addMessageBodyWriter(MessageBodyWriter provider, boolean isBuiltin)
{
PropertyInjectorImpl injector = new PropertyInjectorImpl(provider.getClass(), this);
providers.put(provider.getClass(), provider);
injector.inject(provider);
Produces consumeMime = provider.getClass().getAnnotation(Produces.class);
MessageBodyKey<MessageBodyWriter> key = new MessageBodyKey<MessageBodyWriter>(MessageBodyWriter.class, provider, isBuiltin);
if (consumeMime != null)
{
for (String consume : consumeMime.value())
{
MediaType mime = MediaType.valueOf(consume);
messageBodyWriters.add(mime, key);
}
}