com.mongodb.util.JSON.string()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中com.mongodb.util.JSON.string()方法的一些代码示例,展示了JSON.string()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSON.string()方法的具体详情如下:
包路径:com.mongodb.util.JSON
类名称:JSON
方法名:string

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("}");
}

相关文章