@Override public void call(Injector injector) { Grapher grapher = injector.getInstance(Grapher.class); try { text = grapher.graph(); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Writes the "Dot" graph to a given file. * * @param file file to write to */ public void toFile(File file) throws Exception { PrintWriter out = new PrintWriter(file, "UTF-8"); try { out.write(graph()); } finally { Closeables.close(out, true); } }