Example usage for com.fasterxml.jackson.databind.type TypeFactory constructSpecializedType

List of usage examples for com.fasterxml.jackson.databind.type TypeFactory constructSpecializedType

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.type TypeFactory constructSpecializedType.

Prototype

public JavaType constructSpecializedType(JavaType paramJavaType, Class<?> paramClass) 

Source Link

Usage

From source file:com.addthis.codec.jackson.CodecTypeIdResolver.java

private JavaType _typeFromId(String id, TypeFactory typeFactory) {
    if (Strings.isNullOrEmpty(id)) {
        return null;
    }/*  w w w . j av  a2  s  .  com*/
    Class<?> cls = pluginMap.getClassIfConfigured(id);
    if (cls == null) {
        cls = extraSubTypes.get(id);
    }
    try {
        if (cls == null) {
            cls = pluginMap.getClass(id);
        }
        return typeFactory.constructSpecializedType(_baseType, cls);
    } catch (Exception e) {
        String helpMessage = Plugins.classNameSuggestions(pluginRegistry, pluginMap, id);
        throw new IllegalArgumentException(helpMessage, e);
    }
}