本文整理匯總了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()));
}