1 14 15 package org.quickserver.util.xmlreader; 16 17 import java.util.*; 18 24 public class DatabaseConnectionSet implements java.io.Serializable { 25 private ArrayList databaseConnectionSet=null; 26 27 public DatabaseConnectionSet() { 28 databaseConnectionSet = new ArrayList(); 29 } 30 31 34 public void addDatabaseConnection(DatabaseConnectionConfig dbcConfig) { 35 if(dbcConfig!=null) { 36 databaseConnectionSet.add(dbcConfig); 37 } 38 } 39 40 public Iterator iterator() { 41 return databaseConnectionSet.iterator(); 42 } 43 44 48 public String toXML(String pad) { 49 if(pad==null) pad=""; 50 StringBuffer sb = new StringBuffer (); 51 sb.append(pad+"<database-connection-set>\n"); 52 Iterator iterator = iterator(); 53 while(iterator.hasNext()) { 54 DatabaseConnectionConfig dcc = 55 (DatabaseConnectionConfig)iterator.next(); 56 sb.append(dcc.toXML(pad+"\t")); 57 } 58 sb.append(pad+"</database-connection-set>\n"); 59 return sb.toString(); 60 } 61 } 62 | Popular Tags |