1 28 package org.jvyamlb; 29 30 33 public class ConstructorException extends YAMLException { 34 private String when; 35 private String what; 36 private String note; 37 38 public ConstructorException(final String when, final String what, final String note) { 39 super("ConstructorException " + when + " we had this " + what); 40 this.when = when; 41 this.what = what; 42 this.note = note; 43 } 44 45 public ConstructorException(final Throwable thr) { 46 super(thr); 47 } 48 49 public String toString() { 50 final StringBuffer lines = new StringBuffer (); 51 if(this.when != null) { 52 lines.append(this.when).append("\n"); 53 } 54 if(this.what != null) { 55 lines.append(this.what).append("\n"); 56 } 57 if(this.note != null) { 58 lines.append(this.note).append("\n"); 59 } 60 lines.append(super.toString()); 61 return lines.toString(); 62 } 63 } | Popular Tags |