001 package edu.nrao.sss.validation; 002 003 import java.io.Serializable; 004 import java.util.ArrayList; 005 import java.util.List; 006 007 /** 008 * Thrown when one or more validation failures are detected. 009 * <p> 010 * <b>Version Info:</b> 011 * <table style="margin-left:2em"> 012 * <tr><td>$Revision: 329 $</td></tr> 013 * <tr><td>$Date: 2007-02-06 11:43:05 -0700 (Tue, 06 Feb 2007) $</td></tr> 014 * <tr><td>$Author: dharland $</td></tr> 015 * </table></p> 016 * 017 * @author Brian Truitt 018 * @since 2007-01-26 019 */ 020 public class ValidationException 021 extends RuntimeException 022 implements Serializable 023 { 024 private static final long serialVersionUID = 1L; 025 026 private List<ValidationFailure> failures = new ArrayList<ValidationFailure>(); 027 028 //============================================================================ 029 // 030 //============================================================================ 031 032 /** Creates a new instance. */ 033 public ValidationException() 034 { 035 super(); 036 } 037 038 /** Creates a new instance with the given message. */ 039 public ValidationException(String msg) 040 { 041 super(msg); 042 } 043 044 /** Creates a new instance with the given message and cause. */ 045 public ValidationException(String msg, Throwable th) 046 { 047 super(msg, th); 048 } 049 050 /** Creates a new instance with the given cause. */ 051 public ValidationException(Throwable th) 052 { 053 super(th); 054 } 055 056 //============================================================================ 057 // 058 //============================================================================ 059 060 /** 061 * Returns the list of failures held by this exception. 062 * @return the list of failures held by this exception. 063 */ 064 public List<ValidationFailure> getFailures() 065 { 066 return failures; 067 } 068 }