Java Json String Create toJson(final Document doc)

Here you can find the source of toJson(final Document doc)

Description

to Json

License

Apache License

Declaration

public static String toJson(final Document doc) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.bson.Document;
import org.bson.json.JsonMode;
import org.bson.json.JsonWriterSettings;

public class Main {
    public static String toJson(final Document doc) {
        return toJson(doc, false);
    }/*from w  w w .j  a v  a  2 s. com*/

    public static String toJson(final Document doc, boolean pretty) {
        return doc.toJson(new JsonWriterSettings(JsonMode.SHELL, pretty));
    }
}

Related

  1. toJson()
  2. toJson(Object value)
  3. toJson(String jsonp)
  4. toJson(String org)
  5. toJson(String s)