/** To process a stacktrace. */ public interface StackTraceHelper { public StackTraceData process(Throwable t); public StackTraceData process(StackTraceElement[] stacktrace); } /** the result of the stack trace helper. */ public interface StackTraceData { /** prints to given stream. e.g. System.err*/ public void print(PrintStream out); /** Returns the result as readable text, including suggestions and useful links. */ public String getAnaysis(); } // Usage: StackTraceHelper sth = StackTraceHelperFactory.getDefaultInstance(); // ... catch(Exception exception) { StackTraceData data = sth.process(exception); data.print(System.err); }