當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。