1 30 31 package de.susebox.java.lang; 32 33 import java.lang.RuntimeException ; 37 38 39 43 49 public class ExtRuntimeException 50 extends RuntimeException 51 implements ThrowableList 52 { 53 57 64 public Throwable getCause() { 65 return _next; 66 } 67 68 75 public Throwable nextThrowable() { 76 return getCause(); 77 } 78 79 86 public boolean isWrapper() { 87 return _isWrapper; 88 } 89 90 97 public String getFormat() { 98 return super.getMessage(); 99 } 100 101 108 public Object [] getArguments() { 109 return _args; 110 } 111 112 113 117 124 public ExtRuntimeException(String msg) { 125 this(null, msg, null); 126 } 127 128 142 public ExtRuntimeException(Throwable throwable) { 143 this(throwable, null, null); 144 } 145 146 162 public ExtRuntimeException(Throwable throwable, String msg) { 163 this(throwable, msg, null); 164 } 165 166 181 public ExtRuntimeException(String fmt, Object [] args) { 182 this(null, fmt, args); 183 } 184 185 196 public ExtRuntimeException(Throwable throwable, String fmt, Object [] args) { 197 super(fmt); 198 199 if (throwable != null && fmt == null) { 200 _isWrapper = true; 201 } else { 202 _isWrapper = false; 203 } 204 _next = throwable; 205 _args = args; 206 } 207 208 209 213 221 public String getMessage() { 222 return ThrowableMessageFormatter.getMessage(this); 223 } 224 225 229 232 protected Object [] _args = null; 233 234 237 protected Throwable _next = null; 238 239 244 protected boolean _isWrapper = false; 245 } 246 | Popular Tags |