當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectMapper.setAnnotationIntrospector方法代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.ObjectMapper.setAnnotationIntrospector方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectMapper.setAnnotationIntrospector方法的具體用法?Java ObjectMapper.setAnnotationIntrospector怎麽用?Java ObjectMapper.setAnnotationIntrospector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.fasterxml.jackson.databind.ObjectMapper的用法示例。


在下文中一共展示了ObjectMapper.setAnnotationIntrospector方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: outfitMetadataFilter

import com.fasterxml.jackson.databind.ObjectMapper; //導入方法依賴的package包/類
/**
 * Outfit the given {@link ObjectMapper} with a filter that will treat all metadata map entries as transient.
 *
 * @param om object mapper to modify
 */
private static void outfitMetadataFilter(ObjectMapper om) {
	final String filterName = "exclude-metadata";
	SimpleFilterProvider filters = new SimpleFilterProvider();
	filters.addFilter(filterName, new MetadataPropertyFilter());
	om.setAnnotationIntrospector(new JsonWrapperIntrospector(filterName));
	om.setFilterProvider(filters);
}
 
開發者ID:CMSgov,項目名稱:qpp-conversion-tool,代碼行數:13,代碼來源:JsonWrapper.java

示例2: configureObjectMapper

import com.fasterxml.jackson.databind.ObjectMapper; //導入方法依賴的package包/類
/**
 * Call this method with an {@link ObjectMapper} to configure the object
 * mapper to use this {@link SimpleClassNameIdResolver}.
 *
 * @param mapper the object mapper to configure.
 */
public static void configureObjectMapper(final ObjectMapper mapper) {
    mapper.setAnnotationIntrospector(new DelegatingAnnotationIntrospector.Builder()
            .add(new SimpleClassNameIdResolverAnnotation())
            .build());
    mapper.registerModule(SimpleClassSerializer.getModule());
}
 
開發者ID:gchq,項目名稱:koryphe,代碼行數:13,代碼來源:SimpleClassNameIdResolver.java

示例3: JacksonSerializer

import com.fasterxml.jackson.databind.ObjectMapper; //導入方法依賴的package包/類
public JacksonSerializer() {
    m_objectMapper = new ObjectMapper();
    m_objectMapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(TypeFactory.defaultInstance()));
    m_objectMapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
    m_objectMapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
}
 
開發者ID:Axway,項目名稱:iron,代碼行數:7,代碼來源:JacksonSerializer.java

示例4: setAnnotationIntrospectors

import com.fasterxml.jackson.databind.ObjectMapper; //導入方法依賴的package包/類
private void setAnnotationIntrospectors(ObjectMapper mapper) {
    AnnotationIntrospector curSerIntro = mapper.getSerializationConfig().getAnnotationIntrospector();
    AnnotationIntrospector newSerIntro = AnnotationIntrospectorPair.pair(curSerIntro,
            new MaskableSensitiveDataAnnotationIntrospector());
    mapper.setAnnotationIntrospector(newSerIntro);
}
 
開發者ID:visionarts,項目名稱:power-jambda,代碼行數:7,代碼來源:MaskableObjectMapper.java


注:本文中的com.fasterxml.jackson.databind.ObjectMapper.setAnnotationIntrospector方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。