What are the built-in @Provider classes in Resteasy?

天涯浪子 提交于 2019-12-11 02:05:51

问题


The documentation for the resteasy.use.builtin.providers configuration switch reads:

Whether or not to register default, built-in @Provider classes.

I have set that to false to use my own (GWT) JSON format, but would like to know what i am missing or if is there anyone i should not exclude.

So, what are the built-in @Provider classes in Resteasy, or how can i find them?


回答1:


I don't know a documentation for that. Best way may be to search in the sources.

If you are only using resteasy-jaxrs you can find these providers in the master-branch:

* org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper
* org.jboss.resteasy.core.AcceptHeaderByFileSuffixFilter
* org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPFilter
* org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor
* org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor
* org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor
* org.jboss.resteasy.plugins.providers.DataSourceProvider
* org.jboss.resteasy.plugins.providers.DefaultTextPlain
* org.jboss.resteasy.plugins.providers.DocumentProvider
* org.jboss.resteasy.plugins.providers.FileProvider
* org.jboss.resteasy.plugins.providers.FormUrlEncodedProvider
* org.jboss.resteasy.plugins.providers.IIOImageProvider
* org.jboss.resteasy.plugins.providers.InputStreamProvider
* org.jboss.resteasy.plugins.providers.JaxrsFormProvider
* org.jboss.resteasy.plugins.providers.ReaderProvider
* org.jboss.resteasy.plugins.providers.SerializableProvider
* org.jboss.resteasy.plugins.providers.SourceProvider
* org.jboss.resteasy.plugins.providers.StringTextStar

This are the classes annotated with @Provider. Mostly the same are registered in META-INF/services/ javax.ws.rs.ext.Providers.

But I'm not sure why you want to do disable them. AFAIK if you register a @Provider which @Produces(MediaType.APPLICATION_JSON) or @Consumes(MediaType.APPLICATION_JSON) the default one will be ignored.



来源:https://stackoverflow.com/questions/24345761/what-are-the-built-in-provider-classes-in-resteasy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!