当前位置: 首页>>代码示例>>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;未经允许,请勿转载。