com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder Java Examples

The following examples show how to use com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AppConfigService.java    From haven-platform with Apache License 2.0 5 votes vote down vote up
@Autowired
public AppConfigService(KvMapperFactory kvMapperFactory, ObjectMapper objectMapper) {
    // we must use custom configuration of mapper, but need use most options and modules from global mapper
    this.objectMapper = objectMapper.copy();
    StdTypeResolverBuilder trb = new ObjectMapper.DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT);
    trb.init(JsonTypeInfo.Id.CLASS, new CustomTypeIdResolver()).inclusion(JsonTypeInfo.As.PROPERTY);
    this.objectMapper.setDefaultTyping(trb);
    this.objectMapper.registerModule(new KvSupportModule(kvMapperFactory));
}
 
Example #2
Source File: JacksonAnnotationIntrospector.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Helper method for constructing standard {@link TypeResolverBuilder}
 * implementation.
 */
protected StdTypeResolverBuilder _constructStdTypeResolverBuilder() {
    return new StdTypeResolverBuilder();
}
 
Example #3
Source File: JacksonAnnotationIntrospector.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Helper method for dealing with "no type info" marker; can't be null
 * (as it'd be replaced by default typing)
 */
protected StdTypeResolverBuilder _constructNoTypeResolverBuilder() {
    return StdTypeResolverBuilder.noTypeInfoBuilder();
}