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


Java JsonGenerator.writeString方法代码示例

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


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

示例1: serialize

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

    jgen.writeString(DateUtils.formatISO8601Date(value));
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:9,代码来源:DateTimeJsonSerializer.java

示例2: 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

示例3: writeSubclassFields

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
protected void writeSubclassFields(final JsonGenerator jgen,
                                   final ComboBox component) throws IOException {
  if (component.getEditable() != null) {
    jgen.writeObjectField("editable", component.getEditable().toString());
  }
  if (component.getWidth() != null) {
    jgen.writeObjectField("width", component.getWidth().toString());
  }
  if (component.getValues() != null && component.getValues().size() > 0) {
    jgen.writeArrayFieldStart("values");
    for (String value : component.getValues()) {
      jgen.writeString(value);
    }
    jgen.writeEndArray();
  }
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:18,代码来源:ComboBoxSerializer.java

示例4: serialize

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

  synchronized (value) {
    jgen.writeStartObject();
    jgen.writeStringField("type", "BeakerCodeCell");
    jgen.writeStringField("execution_count", value.executionCount);
    jgen.writeStringField("cell_type", value.cellType);
    jgen.writeFieldName("outputs");
    if (!getObjectSerializer().writeObject(value.outputs, jgen, true))
      jgen.writeString(value.outputs.toString());
    jgen.writeFieldName("metadata");
    if (!getObjectSerializer().writeObject(value.metadata, jgen, true))
      jgen.writeString(value.metadata.toString());
    jgen.writeStringField("source", value.source);
    jgen.writeEndObject();
  }
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:22,代码来源:BeakerCodeCell.java

示例5: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的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

示例6: toJSONString

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
private void toJSONString(String name, ArrowTypeID typeID, List<Field> children, JsonGenerator jsonGenerator) throws IOException {
  jsonGenerator.writeStartObject();
  jsonGenerator.writeFieldName("name");
  jsonGenerator.writeString(name);

  if (typeID != null) {
    jsonGenerator.writeFieldName("type");
    jsonGenerator.writeString(typeID.name());
  }

  if (children != null && children.size() > 0) {
    jsonGenerator.writeFieldName("children");
    jsonGenerator.writeStartArray(children.size());
    for(Field child : children) {
      toJSONString(child.getName(), child.getType().getTypeID(), child.getChildren(), jsonGenerator);
    }
    jsonGenerator.writeEndArray();
  }
  jsonGenerator.writeEndObject();
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:21,代码来源:BatchSchema.java

示例7: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的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

示例8: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(final DividendQualification value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException {
    if (value == null || value == DividendQualification.UNKNOWN) {
        gen.writeNull();
        return;
    }

    switch (value) {
        case PARTIALLY_QUALIFIED_INCOME:
            gen.writeString("P");
            break;
        case QUALIFIED_INCOME:
            gen.writeString("Q");
            break;
        case UNQUALIFIED_INCOME:
            gen.writeString("N");
            break;
        default:
            gen.writeNull();
            break;
    }
}
 
开发者ID:WojciechZankowski,项目名称:iextrading4j,代码行数:23,代码来源:DividendQualificationSerializer.java

示例9: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(Date date,
                      JsonGenerator jsonGenerator,
                      SerializerProvider serializerProvider) throws
                                                             IOException {
    jsonGenerator.writeString(DateUtil.formatIso8601Date(date.toInstant()));
}
 
开发者ID:networknt,项目名称:light-workflow-4j,代码行数:8,代码来源:DateModule.java

示例10: serialize

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

    jgen.writeFieldId(0);
    jgen.writeString(value.samUrl);
    jgen.writeFieldId(1);
    jgen.writeObject(value.sai);
    jgen.writeFieldId(5);
    jgen.writeNumber(value.timestamp.getTime()/1000);
}
 
开发者ID:beduino-project,项目名称:dcaf-java,代码行数:12,代码来源:AccessRequest.java

示例11: serialize

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

	jgen.writeStartArray();
	jgen.writeString(value.uri);
	jgen.writeNumber(value.methods);
	jgen.writeEndArray();
}
 
开发者ID:beduino-project,项目名称:dcaf-java,代码行数:10,代码来源:Authorization.java

示例12: 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.writeStringField(fieldName, convertToString(object));
    } else {
        jsonGenerator.writeString(convertToString(object));
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:StringBasedTypeConverter.java

示例13: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(OvsdbSet set, JsonGenerator generator,
                      SerializerProvider provider)
        throws IOException, JsonProcessingException {
    generator.writeStartArray();
    generator.writeString("set");
    generator.writeStartArray();
    Set javaSet = set.set();
    for (Object key : javaSet) {
        generator.writeObject(key);
    }
    generator.writeEndArray();
    generator.writeEndArray();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:15,代码来源:OvsdbSetSerializer.java

示例14: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(Geometry geom, JsonGenerator generator,
		SerializerProvider serializerProvider) throws IOException,
		JsonProcessingException {
	generator.writeString(geom.toText());
}
 
开发者ID:graphium-project,项目名称:graphium,代码行数:7,代码来源:JacksonGeometrySerializer.java

示例15: serialize

import com.fasterxml.jackson.core.JsonGenerator; //导入方法依赖的package包/类
@Override
public void serialize(DateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
    gen.writeString(ISODateTimeFormat.dateTime().print(value));
}
 
开发者ID:CSCfi,项目名称:exam,代码行数:5,代码来源:DateTimeAdapter.java


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