当前位置: 首页>>代码示例>>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;未经允许,请勿转载。