1 14 15 package org.quickserver.util.xmlreader; 16 17 import java.util.*; 18 19 35 public class InitServerHooks extends ArrayList { 36 39 public void addClassName(String className) { 40 if(className!=null && className.trim().length()!=0) { 41 add(className.trim()); 42 } 43 } 44 45 48 public String toXML(String pad) { 49 if(pad==null) pad=""; 50 StringBuffer sb = new StringBuffer (); 51 sb.append(pad+"<init-server-hooks>\n"); 52 Iterator iterator = iterator(); 53 while(iterator.hasNext()) { 54 String classname = (String ) iterator.next(); 55 sb.append(pad+"\t<class-name>"+classname+"</class-name>\n"); 56 } 57 sb.append(pad+"</init-server-hooks>\n"); 58 return sb.toString(); 59 } 60 } 61 | Popular Tags |