1 8 9 package org.uddi4j.response; 10 11 import java.util.Vector ; 12 13 import org.uddi4j.UDDIElement; 14 import org.uddi4j.UDDIException; 15 import org.w3c.dom.Element ; 16 import org.w3c.dom.NodeList ; 17 18 41 public class BusinessInfos extends UDDIElement { 42 public static final String UDDI_TAG = "businessInfos"; 43 44 protected Element base = null; 45 46 Vector businessInfo = new Vector (); 48 49 53 public BusinessInfos() { 54 } 55 56 66 67 public BusinessInfos(Element base) throws UDDIException { 68 super(base); 70 NodeList nl = null; 71 nl = getChildElementsByTagName(base, BusinessInfo.UDDI_TAG); 72 for (int i=0; i < nl.getLength(); i++) { 73 businessInfo.addElement(new BusinessInfo((Element)nl.item(i))); 74 } 75 } 76 77 82 public void setBusinessInfoVector(Vector s) { 83 businessInfo = s; 84 } 85 86 91 public Vector getBusinessInfoVector() { 92 return businessInfo; 93 } 94 95 99 public void add (BusinessInfo b) { 100 businessInfo.add (b); 101 } 102 103 109 public boolean remove (BusinessInfo b) { 110 return businessInfo.remove (b); 111 } 112 113 118 public BusinessInfo get (int index) { 119 return (BusinessInfo) businessInfo.get (index); 120 } 121 122 126 public int size () { 127 return businessInfo.size (); 128 } 129 130 139 140 public void saveToXML(Element parent) { 141 base = parent.getOwnerDocument().createElement(UDDI_TAG); 142 if (businessInfo!=null) { 144 for (int i=0; i < businessInfo.size(); i++) { 145 ((BusinessInfo)(businessInfo.elementAt(i))).saveToXML(base); 146 } 147 } 148 parent.appendChild(base); 149 } 150 } 151 | Popular Tags |