com.fasterxml.jackson.databind.introspect.Annotated#getType ( )源码实例Demo

下面列出了com.fasterxml.jackson.databind.introspect.Annotated#getType ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: haven-platform   文件: JtModule.java
@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));
}
 
源代码2 项目: haven-platform   文件: KvSupportModule.java
@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));
}
 
源代码3 项目: graphql-spqr   文件: ConvertingDeserializer.java
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();
}
 
源代码4 项目: haven-platform   文件: JtModule.java
@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()));
}
 
源代码5 项目: haven-platform   文件: KvSupportModule.java
@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()));
}
 
源代码6 项目: Rosetta   文件: RosettaAnnotationIntrospector.java
private Type getType(Annotated a) {
  try {
    // Jackson 2.7+
    return a.getType();
  } catch (Throwable t) {
    return a.getGenericType();
  }
}