本文整理匯總了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);
}