Resteasy 内置的@Provider 类是什么? [英] What are the built-in @Provider classes in Resteasy?

查看:78
本文介绍了Resteasy 内置的@Provider 类是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

resteasy.use.builtin.providers 配置开关的文档如下:

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

是否注册默认的、内置的@Provider 类.

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

我已将其设置为 false 以使用我自己的 (GWT) JSON 格式,但想知道我遗漏了什么,或者是否有我不应该排除的人.

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.

那么,Resteasy 中内置的@Provider 类是什么,或者我如何找到它们?

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

推荐答案

我不知道这方面的文档.最好的方法可能是在来源中搜索.

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

如果你只使用 resteasy-jaxrs,你可以在 master-branch 中找到这些提供者:

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

这是用 @Provider 注释的类.在 META-INF/services/javax.ws.rs.ext.Providers.

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

但我不确定您为什么要禁用它们.AFAIK 如果您注册了 @Produces(MediaType.APPLICATION_JSON)@Consumes(MediaType.APPLICATION_JSON)@Provider,默认的将被忽略.

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.

这篇关于Resteasy 内置的@Provider 类是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆