当前位置: 首页>>代码示例>>Java>>正文


Java Annotated.getType方法代码示例

本文整理汇总了Java中com.fasterxml.jackson.databind.introspect.Annotated.getType方法的典型用法代码示例。如果您正苦于以下问题:Java Annotated.getType方法的具体用法?Java Annotated.getType怎么用?Java Annotated.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.fasterxml.jackson.databind.introspect.Annotated的用法示例。


在下文中一共展示了Annotated.getType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findDeserializationConverter

import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findDeserializationConverter(Annotated a) {
    JtToMap ann = a.getAnnotation(JtToMap.class);
    if (ann == null) {
        return null;
    }
    JavaType javaType = a.getType();
    if(a instanceof AnnotatedMethod) {
        AnnotatedMethod am = (AnnotatedMethod) a;
        if(am.getParameterCount() == 1) {
            javaType = am.getParameterType(0);
        } else {
            throw new RuntimeException("Invalid property setter: " + am.getAnnotated());
        }
    }
    return new DeserializationConverterImpl(ann, new Ctx(a, javaType));
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:18,代码来源:JtModule.java

示例2: findDeserializationConverter

import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findDeserializationConverter(Annotated a) {
    Class<? extends PropertyInterceptor>[] interceptors = getInterceptors(a);
    if (interceptors == null) {
        return null;
    }
    JavaType javaType = a.getType();
    if(a instanceof AnnotatedMethod) {
        AnnotatedMethod am = (AnnotatedMethod) a;
        if(am.getParameterCount() == 1) {
            javaType = am.getParameterType(0);
        } else {
            throw new RuntimeException("Invalid property setter: " + am.getAnnotated());
        }
    }
    return new KvInterceptorsDeserializationConverter(interceptors, new KvPropertyContextImpl(a, javaType));
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:18,代码来源:KvSupportModule.java

示例3: extractType

import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
private JavaType extractType(Annotated annotated) {
    if (annotated instanceof AnnotatedMethod) {
        AnnotatedMethod method = (AnnotatedMethod) annotated;
        if (ClassUtils.isSetter(method.getAnnotated())) {
            return method.getParameterType(0);
        }
        return method.getType();
    }
    return annotated.getType();
}
 
开发者ID:leangen,项目名称:graphql-spqr,代码行数:11,代码来源:ConvertingDeserializer.java

示例4: findSerializationConverter

import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findSerializationConverter(Annotated a) {
    JtToMap ann = a.getAnnotation(JtToMap.class);
    if (ann == null) {
        return null;
    }
    return new SerializationConverterImpl(ann, new Ctx(a, a.getType()));
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:9,代码来源:JtModule.java

示例5: findSerializationConverter

import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findSerializationConverter(Annotated a) {
    Class<? extends PropertyInterceptor>[] interceptors = getInterceptors(a);
    if (interceptors == null) {
        return null;
    }
    return new KvInterceptorsSerializationConverter(interceptors, new KvPropertyContextImpl(a, a.getType()));
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:9,代码来源:KvSupportModule.java


注:本文中的com.fasterxml.jackson.databind.introspect.Annotated.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。