本文整理汇总了Java中com.alibaba.fastjson.parser.deserializer.LongFieldDeserializer类的典型用法代码示例。如果您正苦于以下问题:Java LongFieldDeserializer类的具体用法?Java LongFieldDeserializer怎么用?Java LongFieldDeserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LongFieldDeserializer类属于com.alibaba.fastjson.parser.deserializer包,在下文中一共展示了LongFieldDeserializer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFieldDeserializerWithoutASM
import com.alibaba.fastjson.parser.deserializer.LongFieldDeserializer; //导入依赖的package包/类
public FieldDeserializer createFieldDeserializerWithoutASM(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo) {
Class<?> fieldClass = fieldInfo.getFieldClass();
if (fieldClass == Boolean.TYPE || fieldClass == Boolean.class) {
return new BooleanFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == Integer.TYPE || fieldClass == Integer.class) {
return new IntegerFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == Long.TYPE || fieldClass == Long.class) {
return new LongFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == String.class) {
return new StringFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == List.class || fieldClass == ArrayList.class) {
return new ArrayListTypeFieldDeserializer(mapping, clazz, fieldInfo);
}
return new DefaultFieldDeserializer(mapping, clazz, fieldInfo);
}
示例2: createFieldDeserializerWithoutASM
import com.alibaba.fastjson.parser.deserializer.LongFieldDeserializer; //导入依赖的package包/类
public FieldDeserializer createFieldDeserializerWithoutASM(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo) {
Class<?> fieldClass = fieldInfo.getFieldClass();
if (fieldClass == boolean.class || fieldClass == Boolean.class) {
return new BooleanFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == int.class || fieldClass == Integer.class) {
return new IntegerFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == long.class || fieldClass == Long.class) {
return new LongFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == String.class) {
return new StringFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == List.class || fieldClass == ArrayList.class) {
return new ArrayListTypeFieldDeserializer(mapping, clazz, fieldInfo);
}
return new DefaultFieldDeserializer(mapping, clazz, fieldInfo);
}
示例3: createFieldDeserializerWithoutASM
import com.alibaba.fastjson.parser.deserializer.LongFieldDeserializer; //导入依赖的package包/类
public FieldDeserializer createFieldDeserializerWithoutASM(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo) {
Class<?> fieldClass = fieldInfo.getFieldClass();
if (fieldClass == boolean.class || fieldClass == Boolean.class) {
return new BooleanFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == int.class || fieldClass == Integer.class) {
return new IntegerFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == long.class || fieldClass == Long.class) {
return new LongFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == String.class) {
return new StringFieldDeserializer(mapping, clazz, fieldInfo);
}
if (fieldClass == List.class || fieldClass == ArrayList.class) {
Type fieldType = fieldInfo.getFieldType();
if (fieldType instanceof ParameterizedType) {
Type itemType = ((ParameterizedType) fieldType).getActualTypeArguments()[0];
if (itemType == String.class) {
return new ArrayListStringFieldDeserializer(mapping, clazz, fieldInfo);
}
}
return new ArrayListTypeFieldDeserializer(mapping, clazz, fieldInfo);
}
return new DefaultFieldDeserializer(mapping, clazz, fieldInfo);
}