本文整理汇总了Java中com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS属性的典型用法代码示例。如果您正苦于以下问题:Java JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS属性的具体用法?Java JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS怎么用?Java JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
的用法示例。
在下文中一共展示了JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRESTClientProxy
@Override
protected <T> T createRESTClientProxy(String apiUrl, Class<T> proxy) {
List providers = new ArrayList();
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(TypeFactory.defaultInstance()));
JacksonJaxbJsonProvider jsonProvider
= new JacksonJaxbJsonProvider(mapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);
providers.add(jsonProvider);
T t = JAXRSClientFactory.create(apiUrl, proxy, providers, true);
Client client = (Client) t;
client.header("User-Agent", getImplementationName() + "=" + getVersion());
return t;
}
示例2: createProviders
public static List<Object> createProviders(ObjectMapper objectMapper) {
ArrayList providers = new ArrayList();
Annotations[] annotationsToUse = JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS;
providers.add(new JacksonJaxbJsonProvider(objectMapper, annotationsToUse));
providers.add(new ExceptionResponseMapper());
return providers;
}
示例3: getJsonProvider
public static JacksonJaxbJsonProvider getJsonProvider() {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//mapper.getSerializationConfig().addMixInAnnotations(File.class, MixIn_File.class);
JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider(mapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);
provider.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.TRUE);
provider.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, Boolean.FALSE);
return provider;
}
示例4: defaultJsonProvider
protected JacksonJaxbJsonProvider defaultJsonProvider() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.configure(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
return new JacksonJaxbJsonProvider(objectMapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);
}