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. 8 * Also, contains a severity number (int). Zero implies no severity. The higher 9 * the number the greater the severity. 10 * 11 * @author Donald A. Leckie 12 * @version $Revision$, $Date$ 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 /** 21 * Creates a new PMD exception with the specified message. 22 * @param message the message 23 */ 24 public PMDException(String message) { 25 super(message); 26 } 27 28 /** 29 * Creates a new PMD exception with the specified message and the given reason as root cause. 30 * @param message the message 31 * @param reason the root cause 32 */ 33 public PMDException(String message, Exception reason) { 34 super(message, reason); 35 } 36 37 public void setSeverity(int severity) { 38 this.severity = severity; 39 } 40 41 public int getSeverity() { 42 return severity; 43 } 44 }