public class Converters extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
isCheckJsonType
是否对JSON返回的数据类型进行校验,默认不校验。给内部测试JSON返回时用的开关。
规则:返回的"基本"类型只有String,Long,Boolean,Date,采取严格校验方式,如果类型不匹配,报错
|
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
convert(Class<T> clazz,
Reader reader,
String responseType)
使用指定 的读取器去转换字符串为对象。
|
static Field |
getField(Class<?> clazz,
PropertyDescriptor pd) |
public static boolean isCheckJsonType
public static <T> T convert(Class<T> clazz, Reader reader, String responseType) throws ApiException
T - 领域泛型clazz - 领域类型reader - 读取器ApiExceptionpublic static Field getField(Class<?> clazz, PropertyDescriptor pd) throws Exception
ExceptionCopyright © 2021. All rights reserved.