/**
* Get the {@link Gson} instance to use.
* @return The {@link Gson} instance to use, from {@link ContextResolver} if available or the default one
*/
private Gson getGson() {
if (gson == null) {
// init using a contextresolver, if available
ContextResolver<Gson> contextResolver = providers.getContextResolver(Gson.class,
MediaType.APPLICATION_JSON_TYPE);
if (contextResolver != null) {
gson = contextResolver.getContext(Gson.class);
}
if (gson == null) {
// use default
gson = GsonConfiguration.builder().create();
}
}
return gson;
}
GsonJsonProvider.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:holon-json
作者:
评论列表
文章目录