本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}