Advertisement
DulcetAirman

StackTraceHelper

Dec 27th, 2014
247
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** To process a stacktrace. */
  2. public interface StackTraceHelper {
  3.   public StackTraceData process(Throwable t);
  4.   public StackTraceData process(StackTraceElement[] stacktrace);
  5. }
  6. /** the result of the stack trace helper. */
  7. public interface StackTraceData {
  8.   /** prints to given stream. e.g. System.err*/
  9.   public void print(PrintStream out);
  10.   /** Returns the result as readable text, including suggestions and useful links. */
  11.   public String getAnaysis();
  12. }
  13. // Usage:
  14. StackTraceHelper sth = StackTraceHelperFactory.getDefaultInstance();
  15. // ...
  16. catch(Exception exception) {
  17.   StackTraceData  data = sth.process(exception);
  18.   data.print(System.err);
  19. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement