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 40 public class ServiceInfos extends UDDIElement { 41 public static final String UDDI_TAG = "serviceInfos"; 42 43 protected Element base = null; 44 45 Vector serviceInfo = new Vector (); 47 48 52 public ServiceInfos() { 53 } 54 55 65 66 public ServiceInfos(Element base) throws UDDIException { 67 super(base); 69 NodeList nl = null; 70 nl = getChildElementsByTagName(base, ServiceInfo.UDDI_TAG); 71 for (int i=0; i < nl.getLength(); i++) { 72 serviceInfo.addElement(new ServiceInfo((Element)nl.item(i))); 73 } 74 } 75 76 81 public void setServiceInfoVector(Vector s) { 82 serviceInfo = s; 83 } 84 85 90 public Vector getServiceInfoVector() { 91 return serviceInfo; 92 } 93 94 98 public void add (ServiceInfo s) { 99 serviceInfo.add (s); 100 } 101 102 108 public boolean remove (ServiceInfo s) { 109 return serviceInfo.remove (s); 110 } 111 112 117 public ServiceInfo get (int index) { 118 return (ServiceInfo) serviceInfo.get (index); 119 } 120 121 125 public int size () { 126 return serviceInfo.size (); 127 } 128 129 138 139 public void saveToXML(Element parent) { 140 base = parent.getOwnerDocument().createElement(UDDI_TAG); 141 if (serviceInfo!=null) { 143 for (int i=0; i < serviceInfo.size(); i++) { 144 ((ServiceInfo)(serviceInfo.elementAt(i))).saveToXML(base); 145 } 146 } 147 parent.appendChild(base); 148 } 149 } 150 | Popular Tags |