JacksonValueMapper.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:graphql-spqr 作者:
private AnnotatedType getInputFieldType(AnnotatedType type, BeanPropertyDefinition propertyDefinition) {
    AnnotatedParameter ctorParam = propertyDefinition.getConstructorParameter();
    if (ctorParam != null) {
        Constructor<?> constructor = (Constructor<?>) ctorParam.getOwner().getMember();
        return ClassUtils.getParameterTypes(constructor, type)[ctorParam.getIndex()];
    }
    if (propertyDefinition.getSetter() != null) {
        return ClassUtils.getParameterTypes(propertyDefinition.getSetter().getAnnotated(), type)[0];
    }
    if (propertyDefinition.getGetter() != null) {
        return ClassUtils.getReturnType(propertyDefinition.getGetter().getAnnotated(), type);
    }
    if (propertyDefinition.getField() != null) {
        return ClassUtils.getFieldType(propertyDefinition.getField().getAnnotated(), type);
    }
    throw new UnsupportedOperationException("Unknown input field mapping style encountered");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号