本文整理汇总了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));
}
示例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));
}
示例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();
}
示例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()));
}
示例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()));
}