本文整理汇总了Java中org.noggit.JSONWriter.write方法的典型用法代码示例。如果您正苦于以下问题:Java JSONWriter.write方法的具体用法?Java JSONWriter.write怎么用?Java JSONWriter.write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.noggit.JSONWriter
的用法示例。
在下文中一共展示了JSONWriter.write方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeError
import org.noggit.JSONWriter; //导入方法依赖的package包/类
void writeError(int code, String msg) throws IOException {
response.setStatus(code);
CharArr chars = new CharArr();
JSONWriter w = new JSONWriter(chars, 2);
w.startObject();
w.indent();
w.writeString("status");
w.writeNameSeparator();
w.write(code);
w.writeValueSeparator();
w.indent();
w.writeString("error");
w.writeNameSeparator();
w.writeString(msg);
w.endObject();
out.write(chars.toString());
}
示例2: streamToJson
import org.noggit.JSONWriter; //导入方法依赖的package包/类
@Override
public void streamToJson(JSONWriter jsonWriter) {
jsonWriter.write(this.name);
jsonWriter.writeNameSeparator();
jsonWriter.startObject();
jsonWriter.indent();
this.writeStringField(jsonWriter, FIELD_TYPE, this.type);
this.writeValueSeparator(jsonWriter);
this.writeFacetConfiguration(jsonWriter);
this.writeSubFacets(jsonWriter);
jsonWriter.indent();
jsonWriter.endObject();
}
示例3: writeSubFacets
import org.noggit.JSONWriter; //导入方法依赖的package包/类
protected void writeSubFacets(JSONWriter jsonWriter) {
if (this.subFacets.isEmpty()) {
return;
}
this.writeValueSeparator(jsonWriter);
jsonWriter.write(FIELD_FACET);
jsonWriter.writeNameSeparator();
jsonWriter.startObject();
jsonWriter.indent();
this.writeFacets(jsonWriter, this.subFacets);
jsonWriter.indent();
jsonWriter.endObject();
}
示例4: write
import org.noggit.JSONWriter; //导入方法依赖的package包/类
@Override
public void write(JSONWriter jsonWriter) {
LinkedHashMap<String, Object> all = new LinkedHashMap<>(slices.size() + 1);
all.putAll(propMap);
all.put(SHARDS, slices);
jsonWriter.write(all);
}
示例5: writeKeyValue
import org.noggit.JSONWriter; //导入方法依赖的package包/类
public void writeKeyValue(JSONWriter json, String k, Object v, boolean isFirst) {
if (!isFirst) {
json.writeValueSeparator();
}
if (indent) {
json.indent();
}
json.writeString(k);
json.writeNameSeparator();
json.write(v);
}
示例6: write
import org.noggit.JSONWriter; //导入方法依赖的package包/类
@Override
public void write(JSONWriter jsonWriter) {
LinkedHashMap<String, Object> all = new LinkedHashMap<String, Object>(slices.size() + 1);
all.putAll(propMap);
all.put(SHARDS, slices);
jsonWriter.write(all);
}
示例7: streamToJson
import org.noggit.JSONWriter; //导入方法依赖的package包/类
@Override
public void streamToJson(JSONWriter jsonWriter) {
jsonWriter.write(this.getName());
jsonWriter.writeNameSeparator();
jsonWriter.writeString(this.function);
}
示例8: writeBooleanField
import org.noggit.JSONWriter; //导入方法依赖的package包/类
protected void writeBooleanField(JSONWriter jsonWriter, String fieldName, boolean value) {
jsonWriter.write(fieldName);
jsonWriter.writeNameSeparator();
jsonWriter.write(value);
}
示例9: writeNumberField
import org.noggit.JSONWriter; //导入方法依赖的package包/类
protected void writeNumberField(JSONWriter jsonWriter, String fieldName, Number value) {
jsonWriter.write(fieldName);
jsonWriter.writeNameSeparator();
jsonWriter.write(value);
}
示例10: writeStringField
import org.noggit.JSONWriter; //导入方法依赖的package包/类
protected void writeStringField(JSONWriter jsonWriter, String fieldName, String value) {
jsonWriter.write(fieldName);
jsonWriter.writeNameSeparator();
jsonWriter.write(value);
}
示例11: write
import org.noggit.JSONWriter; //导入方法依赖的package包/类
@Override
public void write(JSONWriter jsonWriter) {
jsonWriter.write(collectionStates);
}
示例12: write
import org.noggit.JSONWriter; //导入方法依赖的package包/类
@Override
public void write(JSONWriter jsonWriter) {
jsonWriter.write(propMap);
}
示例13: write
import org.noggit.JSONWriter; //导入方法依赖的package包/类
@Override
public void write(JSONWriter writer) {
writer.write(toString());
}
示例14: writeField
import org.noggit.JSONWriter; //导入方法依赖的package包/类
private void writeField(String key, Object value, JSONWriter writer) {
writer.writeString(key);
writer.writeNameSeparator();
writer.write(value);
}