1 23 24 package org.dbforms.config; 25 26 import java.util.Vector ; 27 28 29 30 35 public class MultipleValidationException extends ValidationException { 36 private Vector messages = null; 37 38 43 public MultipleValidationException(String message) { 44 super(); 45 addMessage(message); 46 } 47 48 49 54 public MultipleValidationException(Vector messages) { 55 super(); 56 this.setMessages(messages); 57 } 58 59 74 public String getMessage() { 75 StringBuffer sb = new StringBuffer (); 76 77 if (messages != null) { 78 for (int i = 0; i < messages.size(); i++) { 79 Object o = messages.elementAt(i); 80 81 if (o != null) { 82 sb.append(o.toString()) 83 .append("\n"); 84 } 85 } 86 } 87 88 return sb.toString(); 89 } 90 91 92 97 public void setMessages(Vector messages) { 98 this.messages = messages; 99 } 100 101 102 107 public Vector getMessages() { 108 return messages; 109 } 110 111 112 117 public void addMessage(String message) { 118 if (messages == null) { 119 messages = new Vector (); 120 } 121 122 messages.add(message); 123 } 124 } 125 | Popular Tags |