本文整理了Java中com.mongodb.util.JSON.string()
方法的一些代码示例,展示了JSON.string()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSON.string()
方法的具体详情如下:
包路径:com.mongodb.util.JSON
类名称:JSON
方法名:string
暂无
代码示例来源:origin: org.mongodb/mongo-java-driver
@Override
public void serialize(final Object obj, final StringBuilder buf) {
JSON.string(buf, (String) obj);
}
}
代码示例来源:origin: org.mongodb/mongo-java-driver
@Override
@SuppressWarnings("rawtypes")
public void serialize(final Object obj, final StringBuilder buf) {
boolean first = true;
buf.append("{ ");
Map m = (Map) obj;
Entry entry;
for (final Object o : m.entrySet()) {
entry = (Entry) o;
if (first) {
first = false;
} else {
buf.append(" , ");
}
JSON.string(buf, entry.getKey().toString());
buf.append(" : ");
serializer.serialize(entry.getValue(), buf);
}
buf.append("}");
}
代码示例来源:origin: org.mongodb/mongo-java-driver
@Override
public void serialize(final Object obj, final StringBuilder buf) {
boolean first = true;
buf.append("{ ");
DBObject dbo = (DBObject) obj;
String name;
for (final String s : dbo.keySet()) {
name = s;
if (first) {
first = false;
} else {
buf.append(" , ");
}
JSON.string(buf, name);
buf.append(" : ");
serializer.serialize(dbo.get(name), buf);
}
buf.append("}");
}
代码示例来源:origin: org.mongodb/mongodb-driver
@Override
public void serialize(final Object obj, final StringBuilder buf) {
JSON.string(buf, (String) obj);
}
}
代码示例来源:origin: org.mongodb/mongodb-driver
@Override
@SuppressWarnings("rawtypes")
public void serialize(final Object obj, final StringBuilder buf) {
boolean first = true;
buf.append("{ ");
Map m = (Map) obj;
Entry entry;
for (final Object o : m.entrySet()) {
entry = (Entry) o;
if (first) {
first = false;
} else {
buf.append(" , ");
}
JSON.string(buf, entry.getKey().toString());
buf.append(" : ");
serializer.serialize(entry.getValue(), buf);
}
buf.append("}");
}
代码示例来源:origin: org.mongodb/mongodb-driver
@Override
public void serialize(final Object obj, final StringBuilder buf) {
boolean first = true;
buf.append("{ ");
DBObject dbo = (DBObject) obj;
String name;
for (final String s : dbo.keySet()) {
name = s;
if (first) {
first = false;
} else {
buf.append(" , ");
}
JSON.string(buf, name);
buf.append(" : ");
serializer.serialize(dbo.get(name), buf);
}
buf.append("}");
}
内容来源于网络,如有侵权,请联系作者删除!