/** * Return the modified JSON representation for the supplied object value. The resulting JSON will be indented for each * name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param value the BSON object or BSON value; may not be null * @return the JSON representation; never null */ public static String writePretty( Object value ) { return getPrettyWriter().write(value); }
/** * Write to the supplied writer the modified JSON representation of the supplied in-memory {@link Document}. The resulting * JSON will be indented for each name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param bson the BSON object or BSON value; may not be null * @param stream the output stream; may not be null * @throws IOException if there was a problem reading from the stream */ public static void writePretty( Document bson, OutputStream stream ) throws IOException { getPrettyWriter().write(bson, stream); }
/** * Return the modified JSON representation for the supplied in-memory {@link Document}. The resulting JSON will be indented * for each name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param bson the BSON object or BSON value; may not be null * @return the JSON representation; never null */ public static String writePretty( Document bson ) { return getPrettyWriter().write(bson); }
/** * Return the modified JSON representation for the supplied object value. The resulting JSON will be indented for each * name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param value the BSON object or BSON value; may not be null * @return the JSON representation; never null */ public static String writePretty( Object value ) { return getPrettyWriter().write(value); }
/** * Return the modified JSON representation for the supplied in-memory {@link Document}. The resulting JSON will be indented * for each name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param bson the BSON object or BSON value; may not be null * @return the JSON representation; never null */ public static String writePretty( Document bson ) { return getPrettyWriter().write(bson); }
/** * Write to the supplied writer the modified JSON representation of the supplied in-memory {@link Document}. The resulting * JSON will be indented for each name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param bson the BSON object or BSON value; may not be null * @param writer the writer; may not be null * @throws IOException if there was a problem reading from the stream */ public static void writePretty( Document bson, Writer writer ) throws IOException { getPrettyWriter().write(bson, writer); }
/** * Write to the supplied writer the modified JSON representation of the supplied in-memory {@link Document}. The resulting * JSON will be indented for each name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param bson the BSON object or BSON value; may not be null * @param stream the output stream; may not be null * @throws IOException if there was a problem reading from the stream */ public static void writePretty( Document bson, OutputStream stream ) throws IOException { getPrettyWriter().write(bson, stream); }
/** * Write to the supplied writer the modified JSON representation of the supplied in-memory {@link Document}. The resulting * JSON will be indented for each name/value pair and each array value. * <p> * This format is very readable by people and software, but is less compact due to the extra whitespace. * </p> * * @param bson the BSON object or BSON value; may not be null * @param writer the writer; may not be null * @throws IOException if there was a problem reading from the stream */ public static void writePretty( Document bson, Writer writer ) throws IOException { getPrettyWriter().write(bson, writer); }