本文整理汇总了Java中com.alibaba.fastjson.util.FieldInfo类的典型用法代码示例。如果您正苦于以下问题:Java FieldInfo类的具体用法?Java FieldInfo怎么用?Java FieldInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldInfo类属于com.alibaba.fastjson.util包,在下文中一共展示了FieldInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: _batchSet
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _batchSet(Context context, MethodVisitor mw, boolean flag) {
for (int i = 0, size = context.fieldInfoList.length; i < size; ++i) {
Label notSet_ = new Label();
if (flag) {
_isFlag(mw, context, i, notSet_);
}
FieldInfo fieldInfo = context.fieldInfoList[i];
_loadAndSet(context, mw, fieldInfo);
if (flag) {
mw.visitLabel(notSet_);
}
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:ASMDeserializerFactory.java
示例2: _getCollectionFieldItemDeser
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _getCollectionFieldItemDeser(Context context, MethodVisitor mw, FieldInfo fieldInfo,
Class<?> itemType) {
Label notNull_ = new Label();
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_list_item_deser__",
desc(ObjectDeserializer.class));
mw.visitJumpInsn(IFNONNULL, notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitVarInsn(ALOAD, 1);
mw.visitMethodInsn(INVOKEVIRTUAL, DefaultJSONParser, "getConfig", "()" + desc(ParserConfig.class));
mw.visitLdcInsn(com.alibaba.fastjson.asm.Type.getType(desc(itemType)));
mw.visitMethodInsn(INVOKEVIRTUAL, type(ParserConfig.class), "getDeserializer",
"(Ljava/lang/reflect/Type;)" + desc(ObjectDeserializer.class));
mw.visitFieldInsn(PUTFIELD, context.className, fieldInfo.name + "_asm_list_item_deser__",
desc(ObjectDeserializer.class));
mw.visitLabel(notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_list_item_deser__",
desc(ObjectDeserializer.class));
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:ASMDeserializerFactory.java
示例3: _getFieldDeser
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _getFieldDeser(Context context, MethodVisitor mw, FieldInfo fieldInfo) {
Label notNull_ = new Label();
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_deser__", desc(ObjectDeserializer.class));
mw.visitJumpInsn(IFNONNULL, notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitVarInsn(ALOAD, 1);
mw.visitMethodInsn(INVOKEVIRTUAL, DefaultJSONParser, "getConfig", "()" + desc(ParserConfig.class));
mw.visitLdcInsn(com.alibaba.fastjson.asm.Type.getType(desc(fieldInfo.fieldClass)));
mw.visitMethodInsn(INVOKEVIRTUAL, type(ParserConfig.class), "getDeserializer",
"(Ljava/lang/reflect/Type;)" + desc(ObjectDeserializer.class));
mw.visitFieldInsn(PUTFIELD, context.className, fieldInfo.name + "_asm_deser__", desc(ObjectDeserializer.class));
mw.visitLabel(notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_deser__", desc(ObjectDeserializer.class));
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:ASMDeserializerFactory.java
示例4: _double
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _double(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label _end = new Label();
_nameApply(mw, property, context, _end);
_get(mw, context, property);
mw.visitVarInsn(DSTORE, context.var("double", 2));
_filters(mw, property, context, _end);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, context.fieldName());
mw.visitVarInsn(DLOAD, context.var("double", 2));
mw.visitMethodInsn(INVOKEVIRTUAL, "com/alibaba/fastjson/serializer/SerializeWriter", "writeFieldValue", "(CLjava/lang/String;D)V");
_seperator(mw, context);
mw.visitLabel(_end);
}
开发者ID:uavorg,项目名称:uavstack,代码行数:20,代码来源:ASMSerializerFactory.java
示例5: _int
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _int(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label _end = new Label();
_nameApply(mw, property, context, _end);
_get(mw, context, property);
mw.visitVarInsn(ISTORE, context.var("int"));
_filters(mw, property, context, _end);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, context.fieldName());
mw.visitVarInsn(ILOAD, context.var("int"));
mw.visitMethodInsn(INVOKEVIRTUAL, "com/alibaba/fastjson/serializer/SerializeWriter", "writeFieldValue", "(CLjava/lang/String;I)V");
_seperator(mw, context);
mw.visitLabel(_end);
}
开发者ID:uavorg,项目名称:uavstack,代码行数:21,代码来源:ASMSerializerFactory.java
示例6: FieldSerializer
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
public FieldSerializer(FieldInfo fieldInfo){
super();
this.fieldInfo = fieldInfo;
fieldInfo.setAccessible(true);
this.double_quoted_fieldPrefix = '"' + fieldInfo.getName() + "\":";
this.single_quoted_fieldPrefix = '\'' + fieldInfo.getName() + "\':";
this.un_quoted_fieldPrefix = fieldInfo.getName() + ":";
JSONField annotation = fieldInfo.getAnnotation(JSONField.class);
if (annotation != null) {
for (SerializerFeature feature : annotation.serialzeFeatures()) {
if (feature == SerializerFeature.WriteMapNullValue) {
writeNull = true;
}
}
}
}
开发者ID:uavorg,项目名称:uavstack,代码行数:21,代码来源:FieldSerializer.java
示例7: _long
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _long(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label end_ = new Label();
_nameApply(mw, property, context, end_);
_get(mw, context, property);
mw.visitVarInsn(LSTORE, context.var("long", 2));
_filters(mw, property, context, end_);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, Context.fieldName);
mw.visitVarInsn(LLOAD, context.var("long", 2));
mw.visitMethodInsn(INVOKEVIRTUAL, SerializeWriter, "writeFieldValue", "(CLjava/lang/String;J)V");
_seperator(mw, context);
mw.visitLabel(end_);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:ASMSerializerFactory.java
示例8: _float
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _float(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label end_ = new Label();
_nameApply(mw, property, context, end_);
_get(mw, context, property);
mw.visitVarInsn(FSTORE, context.var("float"));
_filters(mw, property, context, end_);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, Context.fieldName);
mw.visitVarInsn(FLOAD, context.var("float"));
mw.visitMethodInsn(INVOKEVIRTUAL, SerializeWriter, "writeFieldValue", "(CLjava/lang/String;F)V");
_seperator(mw, context);
mw.visitLabel(end_);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:ASMSerializerFactory.java
示例9: _double
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _double(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label end_ = new Label();
_nameApply(mw, property, context, end_);
_get(mw, context, property);
mw.visitVarInsn(DSTORE, context.var("double", 2));
_filters(mw, property, context, end_);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, Context.fieldName);
mw.visitVarInsn(DLOAD, context.var("double", 2));
mw.visitMethodInsn(INVOKEVIRTUAL, SerializeWriter, "writeFieldValue", "(CLjava/lang/String;D)V");
_seperator(mw, context);
mw.visitLabel(end_);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:ASMSerializerFactory.java
示例10: _byte
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _byte(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label _end = new Label();
_nameApply(mw, property, context, _end);
_get(mw, context, property);
mw.visitVarInsn(ISTORE, context.var("byte"));
_filters(mw, property, context, _end);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, context.fieldName());
mw.visitVarInsn(ILOAD, context.var("byte"));
mw.visitMethodInsn(INVOKEVIRTUAL, "com/alibaba/fastjson/serializer/SerializeWriter", "writeFieldValue", "(CLjava/lang/String;I)V");
_seperator(mw, context);
mw.visitLabel(_end);
}
开发者ID:uavorg,项目名称:uavstack,代码行数:21,代码来源:ASMSerializerFactory.java
示例11: _filters
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _filters(MethodVisitor mw, FieldInfo property, Context context, Label _end) {
if (property.fieldTransient) {
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitLdcInsn(SerializerFeature.SkipTransientField.mask);
mw.visitMethodInsn(INVOKEVIRTUAL, SerializeWriter, "isEnabled", "(I)Z");
mw.visitJumpInsn(IFNE, _end);
}
_notWriteDefault(mw, property, context, _end);
if (context.writeDirect) {
return;
}
_apply(mw, property, context);
mw.visitJumpInsn(IFEQ, _end);
_processKey(mw, property, context);
_processValue(mw, property, context, _end);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:ASMSerializerFactory.java
示例12: _nameApply
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _nameApply(MethodVisitor mw, FieldInfo property, Context context, Label _end) {
if (!context.writeDirect) {
mw.visitVarInsn(ALOAD, 0);
mw.visitVarInsn(ALOAD, Context.serializer);
mw.visitVarInsn(ALOAD, Context.obj);
mw.visitVarInsn(ALOAD, Context.fieldName);
mw.visitMethodInsn(INVOKEVIRTUAL, JavaBeanSerializer, "applyName",
"(L" + JSONSerializer + ";Ljava/lang/Object;Ljava/lang/String;)Z");
mw.visitJumpInsn(IFEQ, _end);
_labelApply(mw, property, context, _end);
}
if (property.field == null) {
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitLdcInsn(SerializerFeature.IgnoreNonFieldGetter.mask);
mw.visitMethodInsn(INVOKEVIRTUAL, SerializeWriter, "isEnabled", "(I)Z");
// if true
mw.visitJumpInsn(IFNE, _end);
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:ASMSerializerFactory.java
示例13: createFieldDeserializer
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
public FieldDeserializer createFieldDeserializer(ParserConfig mapping, Class<?> clazz, FieldInfo fieldInfo) {
return mapping.createFieldDeserializer(mapping, clazz, fieldInfo);
}
开发者ID:uavorg,项目名称:uavstack,代码行数:4,代码来源:ASMJavaBeanDeserializer.java
示例14: _getCollectionFieldItemDeser
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _getCollectionFieldItemDeser(Context context, MethodVisitor mw, FieldInfo fieldInfo, Class<?> itemType) {
Label notNull_ = new Label();
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.getClassName(), fieldInfo.getName() + "_asm_list_item_deser__",
"Lcom/alibaba/fastjson/parser/deserializer/ObjectDeserializer;");
mw.visitJumpInsn(IFNONNULL, notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitVarInsn(ALOAD, 1);
mw.visitMethodInsn(INVOKEVIRTUAL, "com/alibaba/fastjson/parser/DefaultJSONParser", "getConfig", "()"
+ "Lcom/alibaba/fastjson/parser/ParserConfig;");
mw.visitLdcInsn(com.alibaba.fastjson.asm.Type.getType(getDesc(itemType)));
mw.visitMethodInsn(INVOKEVIRTUAL, "com/alibaba/fastjson/parser/ParserConfig", "getDeserializer",
"(Ljava/lang/reflect/Type;)Lcom/alibaba/fastjson/parser/deserializer/ObjectDeserializer;");
mw.visitFieldInsn(PUTFIELD, context.getClassName(), fieldInfo.getName() + "_asm_list_item_deser__",
"Lcom/alibaba/fastjson/parser/deserializer/ObjectDeserializer;");
mw.visitLabel(notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.getClassName(), fieldInfo.getName() + "_asm_list_item_deser__",
"Lcom/alibaba/fastjson/parser/deserializer/ObjectDeserializer;");
}
开发者ID:uavorg,项目名称:uavstack,代码行数:25,代码来源:ASMDeserializerFactory.java
示例15: _getListFieldItemSer
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _getListFieldItemSer(Context context, MethodVisitor mw, FieldInfo fieldInfo, Class<?> itemType) {
Label notNull_ = new Label();
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_list_item_ser_",
ObjectSerializer_desc);
mw.visitJumpInsn(IFNONNULL, notNull_);
mw.visitVarInsn(ALOAD, 0); // this
mw.visitVarInsn(ALOAD, Context.serializer);
mw.visitLdcInsn(com.alibaba.fastjson.asm.Type.getType(desc(itemType)));
mw.visitMethodInsn(INVOKEVIRTUAL, JSONSerializer, "getObjectWriter",
"(Ljava/lang/Class;)" + ObjectSerializer_desc);
mw.visitFieldInsn(PUTFIELD, context.className, fieldInfo.name + "_asm_list_item_ser_",
ObjectSerializer_desc);
mw.visitLabel(notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_list_item_ser_",
ObjectSerializer_desc);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:ASMSerializerFactory.java
示例16: _getFieldSer
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _getFieldSer(Context context, MethodVisitor mw, FieldInfo fieldInfo) {
Label notNull_ = new Label();
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_ser_", ObjectSerializer_desc);
mw.visitJumpInsn(IFNONNULL, notNull_);
mw.visitVarInsn(ALOAD, 0); // this
mw.visitVarInsn(ALOAD, Context.serializer);
mw.visitLdcInsn(com.alibaba.fastjson.asm.Type.getType(desc(fieldInfo.fieldClass)));
mw.visitMethodInsn(INVOKEVIRTUAL, JSONSerializer, "getObjectWriter",
"(Ljava/lang/Class;)" + ObjectSerializer_desc);
mw.visitFieldInsn(PUTFIELD, context.className, fieldInfo.name + "_asm_ser_", ObjectSerializer_desc);
mw.visitLabel(notNull_);
mw.visitVarInsn(ALOAD, 0);
mw.visitFieldInsn(GETFIELD, context.className, fieldInfo.name + "_asm_ser_", ObjectSerializer_desc);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:ASMSerializerFactory.java
示例17: SerializeBeanInfo
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
public SerializeBeanInfo(Class<?> beanType, //
JSONType jsonType, //
String typeName, //
String typeKey,
int features,
FieldInfo[] fields, //
FieldInfo[] sortedFields
){
this.beanType = beanType;
this.jsonType = jsonType;
this.typeName = typeName;
this.typeKey = typeKey;
this.features = features;
this.fields = fields;
this.sortedFields = sortedFields;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:SerializeBeanInfo.java
示例18: _long
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _long(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label _end = new Label();
_nameApply(mw, property, context, _end);
_get(mw, context, property);
mw.visitVarInsn(LSTORE, context.var("long", 2));
_filters(mw, property, context, _end);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, context.fieldName());
mw.visitVarInsn(LLOAD, context.var("long", 2));
mw.visitMethodInsn(INVOKEVIRTUAL, "com/alibaba/fastjson/serializer/SerializeWriter", "writeFieldValue", "(CLjava/lang/String;J)V");
_seperator(mw, context);
mw.visitLabel(_end);
}
开发者ID:uavorg,项目名称:uavstack,代码行数:20,代码来源:ASMSerializerFactory.java
示例19: _char
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的package包/类
private void _char(Class<?> clazz, MethodVisitor mw, FieldInfo property, Context context) {
Label _end = new Label();
_nameApply(mw, property, context, _end);
_get(mw, context, property);
mw.visitVarInsn(ISTORE, context.var("char"));
_filters(mw, property, context, _end);
mw.visitVarInsn(ALOAD, context.var("out"));
mw.visitVarInsn(ILOAD, context.var("seperator"));
mw.visitVarInsn(ALOAD, context.fieldName());
mw.visitVarInsn(ILOAD, context.var("char"));
mw.visitMethodInsn(INVOKEVIRTUAL, "com/alibaba/fastjson/serializer/SerializeWriter", "writeFieldValue", "(CLjava/lang/String;C)V");
_seperator(mw, context);
mw.visitLabel(_end);
}
开发者ID:uavorg,项目名称:uavstack,代码行数:21,代码来源:ASMSerializerFactory.java
示例20: createFieldDeserializerWithoutASM
import com.alibaba.fastjson.util.FieldInfo; //导入依赖的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);
}
开发者ID:uavorg,项目名称:uavstack,代码行数:26,代码来源:ParserConfig.java
注:本文中的com.alibaba.fastjson.util.FieldInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论