@Override public String toString() { try { return dumpXML(doc); } catch (final TransformerException exc) { // NB: Return the exception stack trace as the string. // Although this is a bad idea, I find it somehow hilarious. final ByteArrayOutputStream out = new ByteArrayOutputStream(); exc.printStackTrace(new PrintStream(out)); return out.toString(); } }
@Override public String toString() { try { return dumpXML(doc); } catch (final TransformerException exc) { // NB: Return the exception stack trace as the string. // Although this is a bad idea, I find it somehow hilarious. final ByteArrayOutputStream out = new ByteArrayOutputStream(); exc.printStackTrace(new PrintStream(out)); return out.toString(); } }