* container of the current messager
*/
public static void replaceMessageWriters(Writer newWriter, RootDoc root)
throws Exception {
Messager messager = replaceMessager(root, null);
ObjectAnalyzer analyzer = new ObjectAnalyzer(messager);
ArrayList<PrintWriter> writers = new ArrayList<PrintWriter>();
writers.add((PrintWriter) analyzer.getPrivateField("warnWriter"));
writers.add((PrintWriter) analyzer.getPrivateField("errWriter"));
writers.add((PrintWriter) analyzer.getPrivateField("noticeWriter"));
for (PrintWriter writer : writers) {
new ObjectAnalyzer(writer).setPrivateField("out", newWriter);
}
replaceMessager(root, messager);
}