当前位置: 首页>>代码示例>>Java>>正文


Java JsonGenerator.writeBooleanField方法代码示例

本文整理汇总了Java中com.fasterxml.jackson.core.JsonGenerator.writeBooleanField方法的典型用法代码示例。如果您正苦于以下问题:Java JsonGenerator.writeBooleanField方法的具体用法?Java JsonGenerator.writeBooleanField怎么用?Java JsonGenerator.writeBooleanField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.fasterxml.jackson.core.JsonGenerator的用法示例。


在下文中一共展示了JsonGenerator.writeBooleanField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: serializePagination

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
private void serializePagination(SerializablePagedCollection pagedCol, JsonGenerator jgen) throws IOException,
JsonProcessingException
{
    jgen.writeFieldName("pagination");
    jgen.writeStartObject();
    jgen.writeNumberField("count", pagedCol.getCollection().size());
    jgen.writeBooleanField("hasMoreItems", pagedCol.hasMoreItems());
    Integer totalItems = pagedCol.getTotalItems();
    if(totalItems != null)
    {
    	jgen.writeNumberField("totalItems", totalItems);
    }
    if (pagedCol.getPaging() != null)
    {
        jgen.writeNumberField(RecognizedParamsExtractor.PARAM_PAGING_SKIP, pagedCol.getPaging().getSkipCount());
        jgen.writeNumberField(RecognizedParamsExtractor.PARAM_PAGING_MAX, pagedCol.getPaging().getMaxItems());
    }
    jgen.writeEndObject();
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:SerializerOfCollectionWithPaging.java

示例2: OutputStreamDemo

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
public static void OutputStreamDemo() throws IOException {
    String out = "";
    JsonFactory f = new JsonFactory();
    FileOutputStream fos = new FileOutputStream(new File("user.out.json"));
    JsonGenerator g = f.createGenerator(fos);

    g.writeStartObject();
    g.writeObjectFieldStart("name");
    g.writeStringField("first", "BorLion");
    g.writeStringField("last", "Zhu");
    g.writeEndObject(); // for field 'name'
    g.writeStringField("gender", "MALE");
    g.writeBooleanField("verified", true);
    g.writeBinaryField("userImage", "Rm9vYmFyIQ==".getBytes());
    g.writeEndObject();
    g.writeRaw('\n');
    g.close();

}
 
开发者ID:zhubl,项目名称:planless,代码行数:20,代码来源:Main.java

示例3: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
    public void serialize(Property value, JsonGenerator gen, SerializerProvider provider) throws IOException {

        gen.writeStartObject();

        gen.writeStringField("type", value.getPropertyType().getSimpleName());
        gen.writeBooleanField("indexed", value.isIndexedProperty());

        gen.writeArrayFieldStart("methods");
        if(value.canRead()) { gen.writeString("read"); }
        if(value.canWrite()) { gen.writeString("write"); }
        if(value.canAdd()) { gen.writeString("add"); }
        if(value.canRemove()) { gen.writeString("remove"); }
        if(value.canCount()) { gen.writeString("count"); }
        gen.writeEndArray();
//        if(value.canRead()) { gen.writeNumberField("value");

        gen.writeEndObject();

    }
 
开发者ID:etomica,项目名称:etomica,代码行数:21,代码来源:PropertySerializer.java

示例4: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(JsonGenerator generator) throws IOException {
	generator.writeNumber(getCode());
	generator.writeString(this.realm);
	generator.writeStartObject();
	generator.writeObjectFieldStart("roles");
	for (WampRole wampRole : this.roles) {
		generator.writeObjectFieldStart(wampRole.getRole());
		if (wampRole.hasFeatures()) {
			generator.writeObjectFieldStart("features");
			for (String feature : wampRole.getFeatures()) {
				generator.writeBooleanField(feature, true);
			}
			generator.writeEndObject();
		}
		generator.writeEndObject();
	}
	generator.writeEndObject();
	generator.writeEndObject();
}
 
开发者ID:ralscha,项目名称:wamp2spring,代码行数:21,代码来源:HelloMessage.java

示例5: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(JsonGenerator generator) throws IOException {
	generator.writeNumber(getCode());
	generator.writeNumber(this.requestId);

	generator.writeStartObject();
	if (this.matchPolicy != MatchPolicy.EXACT) {
		generator.writeStringField("match", this.matchPolicy.getExternalValue());
	}
	if (this.getRetained) {
		generator.writeBooleanField("get_retained", this.getRetained);
	}
	generator.writeEndObject();

	generator.writeString(this.topic);
}
 
开发者ID:ralscha,项目名称:wamp2spring,代码行数:17,代码来源:SubscribeMessage.java

示例6: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(final T component,
                      final JsonGenerator jgen,
                      final SerializerProvider serializerProvider) throws IOException {
  jgen.writeStartObject();
  jgen.writeObjectField("type", component.getClass().getSimpleName());
  if (component.getLabel() != null) {
    jgen.writeStringField("label", component.getLabel());
  }
  jgen.writeBooleanField("enabled", component.isEnabled());
  if (component.getValue() != null) {
    jgen.writeObjectField("value", component.getValue());
  }
  writeSubclassFields(jgen, component);
  jgen.writeEndObject();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:17,代码来源:AbstractEasyFormComponentSerializer.java

示例7: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(T object, String fieldName, boolean writeFieldNameForObject, JsonGenerator jsonGenerator) throws IOException {
    if (fieldName != null) {
        jsonGenerator.writeBooleanField(fieldName, convertToBoolean(object));
    } else {
        jsonGenerator.writeBoolean(convertToBoolean(object));
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:BooleanBasedTypeConverter.java

示例8: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(LimitViolationsResult limitViolationsResult, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
    jsonGenerator.writeStartObject();
    jsonGenerator.writeBooleanField("computationOk", limitViolationsResult.isComputationOk());
    jsonGenerator.writeObjectField("limitViolations", limitViolationsResult.getLimitViolations());
    jsonGenerator.writeObjectField("actionsTaken", limitViolationsResult.getActionsTaken());
    jsonGenerator.writeEndObject();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:9,代码来源:LimitViolationsResultSerializer.java

示例9: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(ClassEntity value, JsonGenerator g, SerializerProvider provider) throws IOException {
    g.writeStartObject();
    g.writeStringField("id", value.getId());
    g.writeStringField("value", value.getValue());
    g.writeBooleanField("complex", value.isComplex());
    g.writeEndObject();
}
 
开发者ID:Lambda-3,项目名称:Stargraph,代码行数:9,代码来源:ClassSerializer.java

示例10: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(JsonGenerator generator) throws IOException {
	generator.writeNumber(getCode());
	generator.writeNumber(this.requestId);

	generator.writeStartObject();
	if (this.discloseMe) {
		generator.writeBooleanField("disclose_me", this.discloseMe);
	}
	generator.writeEndObject();

	generator.writeString(this.procedure);

	if (this.argumentsKw != null) {
		if (this.arguments == null) {
			generator.writeStartArray();
			generator.writeEndArray();
		}
		else {
			generator.writeObject(this.arguments);
		}
		generator.writeObject(this.argumentsKw);
	}
	else if (this.arguments != null) {
		generator.writeObject(this.arguments);
	}
}
 
开发者ID:ralscha,项目名称:wamp2spring,代码行数:28,代码来源:CallMessage.java

示例11: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(FirewallRule rule, JsonGenerator jGen,
        SerializerProvider serializer) throws IOException,
        JsonProcessingException {
    jGen.writeStartObject();
    
    jGen.writeNumberField("ruleid", rule.ruleid);
    jGen.writeStringField("dpid", rule.dpid.toString());
    jGen.writeNumberField("in_port", rule.in_port.getPortNumber());
    jGen.writeStringField("dl_src", rule.dl_src.toString());
    jGen.writeStringField("dl_dst", rule.dl_dst.toString());
    jGen.writeNumberField("dl_type", rule.dl_type.getValue());
    jGen.writeStringField("nw_src_prefix", rule.nw_src_prefix_and_mask.getValue().toString());
    jGen.writeNumberField("nw_src_maskbits", rule.nw_src_prefix_and_mask.getMask().asCidrMaskLength());
    jGen.writeStringField("nw_dst_prefix", rule.nw_dst_prefix_and_mask.getValue().toString());
    jGen.writeNumberField("nw_dst_maskbits", rule.nw_dst_prefix_and_mask.getMask().asCidrMaskLength());
    jGen.writeNumberField("nw_proto", rule.nw_proto.getIpProtocolNumber());
    jGen.writeNumberField("tp_src", rule.tp_src.getPort());
    jGen.writeNumberField("tp_dst", rule.tp_dst.getPort());
    jGen.writeBooleanField("any_dpid", rule.any_dpid);
    jGen.writeBooleanField("any_in_port", rule.any_in_port);
    jGen.writeBooleanField("any_dl_src", rule.any_dl_src);
    jGen.writeBooleanField("any_dl_dst", rule.any_dl_dst);
    jGen.writeBooleanField("any_dl_type", rule.any_dl_type);
    jGen.writeBooleanField("any_nw_src", rule.any_nw_src);
    jGen.writeBooleanField("any_nw_dst", rule.any_nw_dst);
    jGen.writeBooleanField("any_nw_proto", rule.any_nw_proto);
    jGen.writeBooleanField("any_tp_src", rule.any_tp_src);
    jGen.writeBooleanField("any_tp_dst", rule.any_tp_dst);
    jGen.writeNumberField("priority", rule.priority);
    jGen.writeStringField("action", String.valueOf(rule.action));
    
    jGen.writeEndObject();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:35,代码来源:FirewallRuleSerializer.java

示例12: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(JsonGenerator generator) throws IOException {
	generator.writeNumber(getCode());
	generator.writeNumber(this.requestId);

	generator.writeStartObject();
	if (this.discloseCaller) {
		generator.writeBooleanField("disclose_caller", this.discloseCaller);
	}
	generator.writeEndObject();

	generator.writeString(this.procedure);

}
 
开发者ID:ralscha,项目名称:wamp2spring,代码行数:15,代码来源:RegisterMessage.java

示例13: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
protected void serialize(T tableDisplay, JsonGenerator jgen) throws IOException {
//    String id = updateManagerProvider.get().register(tableDisplay);
//    tableObjectManagerProvider.get().registerTableDisplay(id, tableDisplay);
//    jgen.writeStringField("update_id", id);
    jgen.writeBooleanField("hasDoubleClickAction", tableDisplay.hasDoubleClickAction());
    jgen.writeStringField("doubleClickTag", tableDisplay.getDoubleClickTag());
    jgen.writeObjectField("contextMenuItems", tableDisplay.getContextMenuItems());
    jgen.writeObjectField("contextMenuTags", tableDisplay.getContextMenuTags());
  }
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:10,代码来源:ObservableTableDisplaySerializer.java

示例14: encodeFrame

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
String encodeFrame() throws IOException {
    StringWriter w = new StringWriter();

    JsonGenerator generator = factory.createGenerator(w);
    generator.writeStartObject();
    generator.writeFieldName("client_oid");
    generator.writeString(getClientOrderId().getId());
    generator.writeFieldName("size");
    generator.writeString(getQuantity().getValue().toString());
    if (price != null && stopPrice == null) {
        generator.writeStringField("type", "limit");
        generator.writeFieldName("price");
        generator.writeString(getPrice().getValue().toString());
        generator.writeBooleanField("post_only", true);
    } else if (stopPrice != null) {
        generator.writeStringField("type", "stop");
        generator.writeFieldName("price");
        generator.writeString(getStopPrice().getValue().toString());
    }
    generator.writeFieldName("side");
    generator.writeString(getSide().toString().toLowerCase());
    generator.writeFieldName("product_id");
    generator.writeString(getProduct().getCode());
    generator.writeFieldName("time_in_force");
    generator.writeString(getTimeInForceCode(getTimeInForce()));
    if (getTimeInForce() == TimeInForce.DAY) {
        generator.writeFieldName("cancel_after");
        generator.writeString("day");
    }
    generator.writeEndObject();
    generator.flush();
    return w.toString();
}
 
开发者ID:cloudwall,项目名称:libcwfincore,代码行数:34,代码来源:GdaxNewOrderSingle.java

示例15: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(PrivateFieldModel object, JsonGenerator jsonGenerator, boolean writeStartAndEnd) throws IOException {
    if (writeStartAndEnd) {
        jsonGenerator.writeStartObject();
    }
    if (object.getStringThatStartsWithM() != null) {
        jsonGenerator.writeStringField("string_to_test_m_vars", object.getStringThatStartsWithM());
    }
    jsonGenerator.writeBooleanField("privateBoolean", object.isPrivateBoolean());
    final List<String> lslocalprivateList = object.getPrivateList();
    if (lslocalprivateList != null) {
        jsonGenerator.writeFieldName("privateList");
        jsonGenerator.writeStartArray();
        for (String element1 : lslocalprivateList) {
            if (element1 != null) {
                jsonGenerator.writeString(element1);
            }
        }
        jsonGenerator.writeEndArray();
    }
    final Map<String, String> lslocalprivateMap = object.getPrivateMap();
    if (lslocalprivateMap != null) {
        jsonGenerator.writeFieldName("privateMap");
        jsonGenerator.writeStartObject();
        for (Map.Entry<String, String> entry1 : lslocalprivateMap.entrySet()) {
            jsonGenerator.writeFieldName(entry1.getKey().toString());
            if (entry1.getValue() != null) {
                jsonGenerator.writeString(entry1.getValue());
            }
        }
        jsonGenerator.writeEndObject();
    }
    if (object.getPrivateNamedString() != null) {
        jsonGenerator.writeStringField("private_named_string", object.getPrivateNamedString());
    }
    if (object.getPrivateString() != null) {
        jsonGenerator.writeStringField("privateString", object.getPrivateString());
    }
    if (writeStartAndEnd) {
        jsonGenerator.writeEndObject();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:43,代码来源:PrivateFieldModel$$JsonObjectMapper.java


注:本文中的com.fasterxml.jackson.core.JsonGenerator.writeBooleanField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。