本文整理匯總了Java中com.fasterxml.jackson.core.JsonGenerator.writeTree方法的典型用法代碼示例。如果您正苦於以下問題:Java JsonGenerator.writeTree方法的具體用法?Java JsonGenerator.writeTree怎麽用?Java JsonGenerator.writeTree使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.fasterxml.jackson.core.JsonGenerator
的用法示例。
在下文中一共展示了JsonGenerator.writeTree方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: serialize
import com.fasterxml.jackson.core.JsonGenerator; //導入方法依賴的package包/類
@Override
public void serialize(JsonGenerator gen, SerializerProvider serializers) throws IOException {
gen.writeStartObject();
gen.writeStringField("op", op);
gen.writeStringField("path", path.toString());
gen.writeFieldName("oldValue");
gen.writeTree(oldValue);
gen.writeFieldName("value");
gen.writeTree(newValue);
gen.writeEndObject();
}
示例2: serialize
import com.fasterxml.jackson.core.JsonGenerator; //導入方法依賴的package包/類
@Override
public final void serialize(final JsonGenerator jgen,
final SerializerProvider provider) throws IOException {
jgen.writeStartObject();
jgen.writeStringField("op", op);
jgen.writeStringField("path", path.toString());
jgen.writeFieldName("value");
jgen.writeTree(value);
jgen.writeEndObject();
}
示例3: serialize
import com.fasterxml.jackson.core.JsonGenerator; //導入方法依賴的package包/類
@Override
public void serialize(JSONOptions value, JsonGenerator jgen, SerializerProvider provider) throws IOException,
JsonGenerationException {
if (value.opaque != null) {
jgen.writeObject(value.opaque);
} else {
jgen.writeTree(value.root);
}
}
示例4: serialize
import com.fasterxml.jackson.core.JsonGenerator; //導入方法依賴的package包/類
@Override
public void serialize(T value, JsonGenerator jgen,
SerializerProvider provider) throws IOException,
JsonGenerationException {
String content = serialize(value);
JsonNode node = this.objectMapper.readTree(content);
jgen.writeTree(node);
}