Java 类com.fasterxml.jackson.databind.type.TypeModifier 实例源码

项目:hibernate-json    文件:JacksonJsonDriver.java   
private JavaType applyModifiers(JavaType resultType, Class<?> sourceType) throws IllegalStateException {
    if (modifiers != null) {
        TypeBindings b = resultType.getBindings();
        if (b == null) {
            b = TypeBindings.emptyBindings();
        }
        for (TypeModifier mod : modifiers) {
            JavaType t = mod.modifyType(resultType, sourceType, b, mapper.getTypeFactory());
            if (t == null) {
                throw new IllegalStateException(String.format(
                        "TypeModifier %s (of type %s) return null for type %s",
                        mod, mod.getClass().getName(), resultType));
            }
            resultType = t;
        }
    }
    return resultType;
}
项目:hibernate-json    文件:JacksonJsonDriver.java   
public JacksonJsonDriver(ObjectMapper mapper) {
    this.mapper = mapper;
    try {
        this.modifiers = (TypeModifier[]) TYPE_FACTORY_MODIFIERS_FIELD.get(mapper.getTypeFactory());
    } catch (IllegalAccessException | IllegalArgumentException e) {
        throw new RuntimeException(e);
    }
}
项目:joyplus-tv    文件:Module.java   
/**
 * Method that module can use to register additional
 * {@link TypeModifier} instance, which can augment {@link com.fasterxml.jackson.databind.JavaType}
 * instances constructed by {@link com.fasterxml.jackson.databind.type.TypeFactory}.
 * 
 * @param modifier to add
 */
public void addTypeModifier(TypeModifier modifier);
项目:QuizUpWinner    文件:Module.java   
public abstract void addTypeModifier(TypeModifier paramTypeModifier);