1 8 9 package org.uddi4j.datatype.business; 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 39 public class Contacts extends UDDIElement { 40 public static final String UDDI_TAG = "contacts"; 41 42 protected Element base = null; 43 44 Vector contact = new Vector (); 46 47 53 public Contacts() { 54 } 55 56 66 public Contacts(Element base) throws UDDIException { 67 super(base); 69 NodeList nl = null; 70 nl = getChildElementsByTagName(base, Contact.UDDI_TAG); 71 for (int i=0; i < nl.getLength(); i++) { 72 contact.addElement(new Contact((Element)nl.item(i))); 73 } 74 } 75 76 81 public void setContactVector(Vector s) { 82 contact = s; 83 } 84 85 90 public Vector getContactVector() { 91 return contact; 92 } 93 94 98 public void add (Contact c) { 99 contact.add (c); 100 } 101 102 108 public boolean remove (Contact c) { 109 return contact.remove (c); 110 } 111 112 117 public Contact get (int index) { 118 return (Contact) contact.get (index); 119 } 120 121 125 public int size () { 126 return contact.size (); 127 } 128 129 138 public void saveToXML(Element parent) { 139 base = parent.getOwnerDocument().createElement(UDDI_TAG); 140 if (contact!=null) { 142 for (int i=0; i < contact.size(); i++) { 143 ((Contact)(contact.elementAt(i))).saveToXML(base); 144 } 145 } 146 parent.appendChild(base); 147 } 148 } 149 | Popular Tags |