當前位置: 首頁>>代碼示例>>Java>>正文


Java JSONField類代碼示例

本文整理匯總了Java中com.alibaba.fastjson.annotation.JSONField的典型用法代碼示例。如果您正苦於以下問題:Java JSONField類的具體用法?Java JSONField怎麽用?Java JSONField使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JSONField類屬於com.alibaba.fastjson.annotation包,在下文中一共展示了JSONField類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isSymmetric

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(serialize = false)
public boolean isSymmetric(){
    if (getRowCount() != getColumnCount()) return false;

    for (Map.Entry<Integer, Vec> rowEntry : rows.entrySet())
    {
        int row = rowEntry.getKey();
        Vec rowVec = rowEntry.getValue();

        for (Integer col : rowVec.getData().keySet())
        {
            if (row == col.intValue()) continue;
            if(DoubleUtils.equals(rowVec.get(col), this.get(col, row))){
                return false;
            }
        }
    }

    return true;
}
 
開發者ID:chen0040,項目名稱:java-reinforcement-learning,代碼行數:21,代碼來源:Matrix.java

示例2: createFieldDeserializer

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
public FieldDeserializer createFieldDeserializer(ParserConfig mapping, //
                                                 JavaBeanInfo beanInfo, //
                                                 FieldInfo fieldInfo) {
    Class<?> clazz = beanInfo.clazz;
    Class<?> fieldClass = fieldInfo.fieldClass;

    Class<?> deserializeUsing = null;
    JSONField annotation = fieldInfo.getAnnotation();
    if (annotation != null) {
        deserializeUsing = annotation.deserializeUsing();
        if (deserializeUsing == Void.class) {
            deserializeUsing = null;
        }
    }

    if (deserializeUsing == null && (fieldClass == List.class || fieldClass == ArrayList.class)) {
        return new ArrayListTypeFieldDeserializer(mapping, clazz, fieldInfo);
    }

    return new DefaultFieldDeserializer(mapping, clazz, fieldInfo);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:ParserConfig.java

示例3: getSupperMethodAnnotation

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
public static JSONField getSupperMethodAnnotation(Class<?> clazz, Method method) {
    for (Class<?> interfaceClass : clazz.getInterfaces()) {
        for (Method interfaceMethod : interfaceClass.getMethods()) {
            if (interfaceMethod.getName().equals(method.getName()) && interfaceMethod.getParameterTypes().length == method.getParameterTypes().length) {
                boolean match = true;
                for (int i = 0; i < interfaceMethod.getParameterTypes().length; i++) {
                    if (!interfaceMethod.getParameterTypes()[i].equals(method.getParameterTypes()[i])) {
                        match = false;
                        break;
                    }
                }
                if (match) {
                    JSONField annotation = (JSONField) interfaceMethod.getAnnotation(JSONField.class);
                    if (annotation != null) {
                        return annotation;
                    }
                } else {
                    continue;
                }
            }
        }
    }
    return null;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:25,代碼來源:TypeUtils.java

示例4: createFieldDeserializer

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
public FieldDeserializer createFieldDeserializer(ParserConfig mapping, //
                                                 JavaBeanInfo beanInfo, //
                                                 FieldInfo fieldInfo) {
    Class<?> clazz = beanInfo.clazz;
    Class<?> fieldClass = fieldInfo.fieldClass;

    Class<?> deserializeUsing = null;
    JSONField annotation = fieldInfo.getAnnotation();
    if (annotation != null) {
        deserializeUsing = annotation.deserializeUsing();
        if (deserializeUsing == Void.class) {
            deserializeUsing = null;
        }
    }

    if (deserializeUsing == null && (fieldClass == List.class || fieldClass == ArrayList.class)) {
        return new ArrayListTypeFieldDeserializer(mapping, clazz, fieldInfo);
    }

    return new DefaultFieldDeserializerBug569(mapping, clazz, fieldInfo);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:ParserConfigBug569.java

示例5: FieldSerializer

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的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

示例6: getAnnotation

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
public JSONField getAnnotation() {
    if (this.fieldAnnotation != null) {
        return this.fieldAnnotation;
    }
    
    return this.methodAnnotation;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:FieldInfo.java

示例7: getPrimaryKey

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(serialize = false)
protected String getPrimaryKey() {
    if (primaryKey != null) {
        return primaryKey;
    }
    String[] primaryKeys = getPrimaryKeys();
    if (null != primaryKeys && primaryKeys.length == 1) {
        primaryKey = primaryKeys[0];
    }

    JbootAssert.assertTrue(primaryKey != null, String.format("get PrimaryKey is error in[%s]", getClass()));
    return primaryKey;
}
 
開發者ID:yangfuhai,項目名稱:jboot,代碼行數:14,代碼來源:JbootModel.java

示例8: getType

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(serialize = false)
public RemotingCommandType getType() {
    if (this.isResponseType()) {
        return RemotingCommandType.RESPONSE_COMMAND;
    }

    return RemotingCommandType.REQUEST_COMMAND;
}
 
開發者ID:lyy4j,項目名稱:rmq4note,代碼行數:9,代碼來源:RemotingCommand.java

示例9: _enum

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
private void _enum(Class<?> cls, MethodVisitor mw, FieldInfo property, Context context) {
    boolean writeEnumUsingToString = false;
    JSONField annotation = (JSONField) property.getAnnotation(JSONField.class);
    if (annotation != null) {
        for (SerializerFeature feature : annotation.serialzeFeatures()) {
            if (feature == SerializerFeature.WriteEnumUsingToString) {
                writeEnumUsingToString = true;
            }
        }
    }
    Label _not_null = new Label();
    Label _end_if = new Label();
    Label _end = new Label();
    _nameApply(mw, property, context, _end);
    _get(mw, context, property);
    mw.visitTypeInsn(192, "java/lang/Enum");
    mw.visitVarInsn(58, context.var("enum"));
    _filters(mw, property, context, _end);
    mw.visitVarInsn(25, context.var("enum"));
    mw.visitJumpInsn(199, _not_null);
    _if_write_null(mw, property, context);
    mw.visitJumpInsn(167, _end_if);
    mw.visitLabel(_not_null);
    mw.visitVarInsn(25, context.var("out"));
    mw.visitVarInsn(21, context.var("seperator"));
    mw.visitVarInsn(25, context.fieldName());
    mw.visitVarInsn(25, context.var("enum"));
    if (writeEnumUsingToString) {
        mw.visitMethodInsn(182, "java/lang/Object", "toString", "()Ljava/lang/String;");
        mw.visitMethodInsn(182, "com/alibaba/fastjson/serializer/SerializeWriter", "writeFieldValue", "(CLjava/lang/String;Ljava/lang/String;)V");
    } else {
        mw.visitMethodInsn(182, "com/alibaba/fastjson/serializer/SerializeWriter", "writeFieldValue", "(CLjava/lang/String;Ljava/lang/Enum;)V");
    }
    _seperator(mw, context);
    mw.visitLabel(_end_if);
    mw.visitLabel(_end);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:38,代碼來源:ASMSerializerFactory.java

示例10: getTransactionType

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(serialize = false)
public TransactionType getTransactionType() {
    return transactionType;
}
 
開發者ID:AschPlatform,項目名稱:asch-java,代碼行數:5,代碼來源:TransactionInfo.java

示例11: isRefundSuccess

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(serialize = false)
public boolean isRefundSuccess(int num) {
    return String.valueOf(num).equals(successNum);
}
 
開發者ID:24solar,項目名稱:pay4j,代碼行數:5,代碼來源:AlipayRefundResult.java

示例12: kkId

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(name="id")
public VOBuilder kkId(int id) {
    vo.id = id;
    return this;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:BuilderTest3_private.java

示例13: setNextOpenid

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(name = "next_openid")
public void setNextOpenid(String nextOpenid) {
	this.nextOpenid = nextOpenid;
}
 
開發者ID:funtl,項目名稱:framework,代碼行數:5,代碼來源:Follwers.java

示例14: setA3

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(deserialize = true)
public void setA3(String a3) {
    this.a3 = a3;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:TestEntity.java

示例15: isOnewayRPC

import com.alibaba.fastjson.annotation.JSONField; //導入依賴的package包/類
@JSONField(serialize = false)
public boolean isOnewayRPC() {
    int bits = 1 << RPC_ONEWAY;
    return (this.flag & bits) == bits;
}
 
開發者ID:lyy4j,項目名稱:rmq4note,代碼行數:6,代碼來源:RemotingCommand.java


注:本文中的com.alibaba.fastjson.annotation.JSONField類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。