1 5 6 package javax.xml.bind; 7 8 28 29 public class TypeConstraintException extends java.lang.RuntimeException { 30 31 35 private String errorCode; 36 37 41 private Throwable linkedException; 42 43 44 50 public TypeConstraintException(String message) { 51 this( message, null, null ); 52 } 53 54 61 public TypeConstraintException(String message, String errorCode) { 62 this( message, errorCode, null ); 63 } 64 65 71 public TypeConstraintException(Throwable exception) { 72 this( null, null, exception ); 73 } 74 75 82 public TypeConstraintException(String message, Throwable exception) { 83 this( message, null, exception ); 84 } 85 86 94 public TypeConstraintException(String message, String errorCode, Throwable exception) { 95 super( message ); 96 this.errorCode = errorCode; 97 this.linkedException = exception; 98 } 99 100 105 public String getErrorCode() { 106 return this.errorCode; 107 } 108 109 114 public Throwable getLinkedException() { 115 return linkedException; 116 } 117 118 125 public synchronized void setLinkedException( Throwable exception ) { 126 this.linkedException = exception; 127 } 128 129 133 public String toString() { 134 return linkedException == null ? 135 super.toString() : 136 super.toString() + "\n - with linked exception:\n[" + 137 linkedException.toString()+ "]"; 138 } 139 140 146 public void printStackTrace( java.io.PrintStream s ) { 147 if( linkedException != null ) { 148 linkedException.printStackTrace(s); 149 s.println("--------------- linked to ------------------"); 150 } 151 152 super.printStackTrace(s); 153 } 154 155 160 public void printStackTrace() { 161 printStackTrace(System.err); 162 } 163 164 } | Popular Tags |