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


Java SerializerProvider.defaultSerializeValue方法代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.SerializerProvider.defaultSerializeValue方法的典型用法代碼示例。如果您正苦於以下問題:Java SerializerProvider.defaultSerializeValue方法的具體用法?Java SerializerProvider.defaultSerializeValue怎麽用?Java SerializerProvider.defaultSerializeValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.fasterxml.jackson.databind.SerializerProvider的用法示例。


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

示例1: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(JoinFunction value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeArrayFieldStart("Fn::Join");
    gen.writeString(value.getSeparator());

    if (value.isExplicitArray()) {
        gen.writeStartArray();
    }

    for (ValueType valueType : value.getStrings()) {
        serializers.defaultSerializeValue(valueType, gen);
    }

    if (value.isExplicitArray()) {
        gen.writeEndArray();
    }
    gen.writeEndArray();
    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:22,代碼來源:JoinFunction.java

示例2: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(SelectFunction value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeArrayFieldStart("Fn::Select");
    gen.writeString(value.getIndex());

    if (value.isExplicitArray()) {
        gen.writeStartArray();
    }

    for (ValueType valueType : value.getStrings()) {
        serializers.defaultSerializeValue(valueType, gen);
    }

    if (value.isExplicitArray()) {
        gen.writeEndArray();
    }
    gen.writeEndArray();
    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:22,代碼來源:SelectFunction.java

示例3: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(SubFunction value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeFieldName("Fn::Sub");

    if (value.getVariableMap() == null) {
        gen.writeString(value.getStringTemplate());
    } else {
        gen.writeStartArray();
        gen.writeString(value.getStringTemplate());
        serializers.defaultSerializeValue(value.getVariableMap(), gen);
        gen.writeEndArray();
    }

    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:18,代碼來源:SubFunction.java

示例4: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
/**
  * Performs the serialization of a OneComponentTime object
  */
@Override
public void serialize(CumulativeTimeBucket ctb,
                JsonGenerator jGen,
                SerializerProvider serializer) 
                throws IOException, JsonProcessingException {
    jGen.writeStartObject();
    Timestamp ts = new Timestamp(ctb.getStartTimeNs()/1000000);
    jGen.writeStringField("start-time", ts.toString());
    jGen.writeStringField("current-time", 
      new Timestamp(System.currentTimeMillis()).toString());
    jGen.writeNumberField("total-packets", ctb.getTotalPktCnt());
    jGen.writeNumberField("average", ctb.getAverageProcTimeNs());
    jGen.writeNumberField("min", ctb.getMinTotalProcTimeNs());
    jGen.writeNumberField("max", ctb.getMaxTotalProcTimeNs());
    jGen.writeNumberField("std-dev", ctb.getTotalSigmaProcTimeNs());
    jGen.writeArrayFieldStart("modules");
    for (OneComponentTime oct : ctb.getModules()) {
        serializer.defaultSerializeValue(oct, jGen);
    }
    jGen.writeEndArray();
    jGen.writeEndObject();
}
 
開發者ID:xuraylei,項目名稱:fresco_floodlight,代碼行數:26,代碼來源:CumulativeTimeBucketJSONSerializer.java

示例5: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(PageImpl value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeNumberField("number", value.getNumber());
    gen.writeNumberField("numberOfElements", value.getNumberOfElements());
    gen.writeNumberField("totalElements", value.getTotalElements());
    gen.writeNumberField("totalPages", value.getTotalPages());
    gen.writeNumberField("size", value.getSize());
    gen.writeFieldName("content");
    serializers.defaultSerializeValue(value.getContent(), gen);
    gen.writeEndObject();
}
 
開發者ID:hantsy,項目名稱:spring-microservice-sample,代碼行數:13,代碼來源:PageJsonSerializer.java

示例6: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(com.salesforce.cf2pojo.model.RefValue value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeFieldName("Ref");
    serializers.defaultSerializeValue(value.getValue(), gen);
    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:9,代碼來源:RefValue.java

示例7: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(
    com.salesforce.cf2pojo.model.GetAttFunction value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeArrayFieldStart("Fn::GetAtt");
    serializers.defaultSerializeValue(value.getLogicalNameOfResource(), gen);
    serializers.defaultSerializeValue(value.getAttributeName(), gen);
    gen.writeEndArray();
    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:12,代碼來源:GetAttFunction.java

示例8: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(Base64Function value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeFieldName("Fn::Base64");
    serializers.defaultSerializeValue(value.getToEncode(), gen);
    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:9,代碼來源:Base64Function.java

示例9: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(FindInMapFunction value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeArrayFieldStart("Fn::FindInMap");
    serializers.defaultSerializeValue(value.getMapName(), gen);
    serializers.defaultSerializeValue(value.getTopLevelKey(), gen);
    serializers.defaultSerializeValue(value.getSecondLevelKey(), gen);
    gen.writeEndArray();
    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:12,代碼來源:FindInMapFunction.java

示例10: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(IfFunction value, JsonGenerator gen, SerializerProvider serializers)
    throws IOException, JsonProcessingException {
    gen.writeStartObject();
    gen.writeArrayFieldStart("Fn::If");
    serializers.defaultSerializeValue(value.getConditionName(), gen);
    serializers.defaultSerializeValue(value.getThenValue(), gen);
    serializers.defaultSerializeValue(value.getElseValue(), gen);
    gen.writeEndArray();
    gen.writeEndObject();
}
 
開發者ID:salesforce,項目名稱:cf2pojo,代碼行數:12,代碼來源:IfFunction.java

示例11: serialize

import com.fasterxml.jackson.databind.SerializerProvider; //導入方法依賴的package包/類
@Override
public void serialize(Device device, JsonGenerator jGen,
                      SerializerProvider serializer) throws IOException,
        JsonProcessingException {
    jGen.writeStartObject();
    
    jGen.writeStringField("entityClass", device.getEntityClass().getName());
    
    jGen.writeArrayFieldStart("mac");
    jGen.writeString(device.getMACAddress().toString());
    jGen.writeEndArray();

    jGen.writeArrayFieldStart("ipv4");
    for (IPv4Address ip : device.getIPv4Addresses())
        jGen.writeString(ip.toString());
    jGen.writeEndArray();

    jGen.writeArrayFieldStart("vlan");
    for (VlanVid vlan : device.getVlanId())
        if (vlan.getVlan() >= 0)
            jGen.writeString(vlan.toString());
    jGen.writeEndArray();
    jGen.writeArrayFieldStart("attachmentPoint");
    for (SwitchPort ap : device.getAttachmentPoints(true)) {
        serializer.defaultSerializeValue(ap, jGen);
    }
    jGen.writeEndArray();

    jGen.writeNumberField("lastSeen", device.getLastSeen().getTime());
    
    String dhcpClientName = device.getDHCPClientName();
    if (dhcpClientName != null) {
        jGen.writeStringField("dhcpClientName", dhcpClientName);
    }

    jGen.writeEndObject();
}
 
開發者ID:nsg-ethz,項目名稱:iTAP-controller,代碼行數:38,代碼來源:DeviceSerializer.java


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