/** * Serializes this processing result as JSON to the provided <code>writer</code>. The * output includes all documents, clusters and other attributes. * <p> * This method is not thread-safe, external synchronization must be applied if needed. * </p> * * @param writer the writer to serialize this processing result to. The writer will * <strong>not</strong> be closed. * @throws IOException in case of any problems with serialization */ public void serializeJson(Writer writer) throws IOException { serializeJson(writer, null); }
/** * Serializes this processing result as JSON to the provided <code>writer</code>. The * output includes all documents, clusters and other attributes. * <p> * This method is not thread-safe, external synchronization must be applied if needed. * </p> * * @param writer the writer to serialize this processing result to. The writer will * <strong>not</strong> be closed. * @param callback JavaScript function name in which to wrap the JSON response or * <code>null</code>. * @throws IOException in case of any problems with serialization */ public void serializeJson(Writer writer, String callback) throws IOException { serializeJson(writer, callback, true, true); }
/** * Serializes this processing result as JSON to the provided <code>writer</code>. * <p> * This method is not thread-safe, external synchronization must be applied if needed. * </p> * * @param writer the writer to serialize this processing result to. The writer will * <strong>not</strong> be closed. * @param callback JavaScript function name in which to wrap the JSON response or * <code>null</code>. * @param indent if <code>true</code>, the output JSON will be pretty-printed * @param saveDocuments if <code>false</code>, documents will not be serialized. * @param saveClusters if <code>false</code>, clusters will not be serialized * @throws IOException in case of any problems with serialization */ public void serializeJson(Writer writer, String callback, boolean indent, boolean saveDocuments, boolean saveClusters) throws IOException { serializeJson(writer, callback, indent, saveDocuments, saveClusters, true); }
/** * Serializes this processing result as JSON to the provided <code>writer</code>. * Documents and clusters can be included or skipped in the output as requested. Other * attributes are always included. * <p> * This method is not thread-safe, external synchronization must be applied if needed. * </p> * * @param writer the writer to serialize this processing result to. The writer will * <strong>not</strong> be closed. * @param callback JavaScript function name in which to wrap the JSON response or * <code>null</code>. * @param saveDocuments if <code>false</code>, documents will not be serialized. * @param saveClusters if <code>false</code>, clusters will not be serialized * @throws IOException in case of any problems with serialization */ public void serializeJson(Writer writer, String callback, boolean saveDocuments, boolean saveClusters) throws IOException { serializeJson(writer, callback, false, saveDocuments, saveClusters); }