1 /** 2 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html 3 */ 4 package net.sourceforge.pmd; 5 6 /** 7 * A convenience exception wrapper. Contains the original exception, if any. Also, contains 8 * a severity number (int). Zero implies no severity. The higher the number the greater the 9 * severity. 10 * 11 * @author Donald A. Leckie 12 * @version $Revision: 5681 $, $Date: 2007-11-30 14:00:56 -0800 (Fri, 30 Nov 2007) $ 13 * @since August 30, 2002 14 */ 15 public class PMDException extends Exception { 16 private static final long serialVersionUID = 6938647389367956874L; 17 18 private int severity; 19 20 public PMDException(String message) { 21 super(message); 22 } 23 24 public PMDException(String message, Exception reason) { 25 super(message, reason); 26 } 27 28 /** 29 * Returns the cause of this exception or <code>null</code> 30 * 31 * @return the cause of this exception or <code>null</code> 32 * @deprecated use {@link #getCause()} instead 33 */ 34 @Deprecated 35 public Exception getReason() { 36 return (Exception) getCause(); 37 } 38 39 public void setSeverity(int severity) { 40 this.severity = severity; 41 } 42 43 public int getSeverity() { 44 return severity; 45 } 46 }