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