1 package xdoclet.retest.util; 2 3 import xdoclet.util.Translator; 4 import xdoclet.XDocletException; 5 import xdoclet.retest.XDocletRetestMessages; 6 7 import java.util.List ; 8 import java.util.ArrayList ; 9 import java.util.Iterator ; 10 11 16 public class ComparisonResultSet 17 { 18 protected List messages; 19 20 public ComparisonResultSet() 21 { 22 messages = new ArrayList (); 23 } 24 25 public String [] getMessages() 26 { 27 return (String [])messages.toArray(new String [messages.size()]); 28 } 29 30 public void addError(String message, String [] params) 31 throws XDocletException 32 { 33 messages.add(Translator.getString(XDocletRetestMessages.class, message, params)); 34 } 35 36 public boolean error() 37 { 38 return messages.size() > 0; 39 } 40 41 public String toString() 42 { 43 String ret=""; 44 if (messages.size() > 0) 45 { 46 ret = ret + "==== " + messages.size() + " error(s) ====\n"; 47 Iterator it = messages.iterator(); 48 while (it.hasNext()) 49 { 50 ret = ret + "========== " + (String )it.next() + "\n"; 51 } 52 } 53 return ret; 54 } 55 56 57 } 58 | Popular Tags |