1 16 17 package org.apache.commons.latka; 18 19 26 public class ValidationException extends Exception { 27 28 31 public ValidationException() { 32 this(null, null); 33 } 34 35 41 public ValidationException(String label, String reason) { 42 _label = label; 43 _reason = reason; 44 } 45 46 47 private String _label = null; 48 49 50 private String _reason = null; 51 52 57 public String getMessage() { 58 StringBuffer buf = new StringBuffer (); 59 if (null != getLabel()) { 60 buf.append(getLabel()); 61 if (null != getReason()) { 62 buf.append(": "); 63 } 64 } 65 if (null != getReason()) { 66 buf.append(getReason()); 67 } 68 return buf.toString(); 69 } 70 71 75 public String getLabel() { 76 return _label; 77 } 78 79 83 public String getReason() { 84 return _reason; 85 } 86 } 87 | Popular Tags |