1 8 14 package jfun.yan.lifecycle; 15 16 22 final class ExceptionWriter implements ExceptionHandler { 23 private final java.io.PrintWriter out; 24 25 ExceptionWriter(final java.io.PrintWriter out) { 26 this.out = out; 27 } 28 29 public void handle(Throwable th) { 30 th.printStackTrace(); 31 } 32 public boolean equals(Object obj) { 33 if(obj==this) return true; 34 if(obj instanceof ExceptionWriter){ 35 final ExceptionWriter eh2 = (ExceptionWriter)obj; 36 return out.equals(eh2.out); 37 } 38 else return false; 39 } 40 public int hashCode() { 41 return out.hashCode(); 42 } 43 public String toString() { 44 return out.toString(); 45 } 46 47 } 48 | Popular Tags |