1 package com4j.tlbimp; 2 3 import java.util.List ; 4 import java.util.ArrayList ; 5 6 11 public class BindingException extends Exception { 12 public BindingException(String message) { 13 super(message); 14 } 15 16 public BindingException(String message, Throwable cause) { 17 super(message, cause); 18 } 19 20 public BindingException(Throwable cause) { 21 super(cause); 22 } 23 24 private final List <String > contexts = new ArrayList <String >(); 25 26 void addContext( String ctxt ) { 27 contexts.add(ctxt); 28 } 29 30 public String getMessage() { 31 StringBuilder buf = new StringBuilder (); 32 buf.append(super.getMessage()); 33 for( String s : contexts ) 34 buf.append("\n ").append(s); 35 return buf.toString(); 36 } 37 } 38 | Popular Tags |