1 8 9 package org.uddi4j.datatype.binding; 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 BindingTemplates extends UDDIElement { 41 public static final String UDDI_TAG = "bindingTemplates"; 42 43 protected Element base = null; 44 45 Vector bindingTemplate = new Vector (); 47 48 52 public BindingTemplates() { 53 } 54 55 65 public BindingTemplates(Element base) throws UDDIException { 66 super(base); 68 NodeList nl = null; 69 nl = getChildElementsByTagName(base, BindingTemplate.UDDI_TAG); 70 for (int i=0; i < nl.getLength(); i++) { 71 bindingTemplate.addElement(new BindingTemplate((Element)nl.item(i))); 72 } 73 } 74 75 80 public void setBindingTemplateVector(Vector s) { 81 bindingTemplate = s; 82 } 83 84 89 public Vector getBindingTemplateVector() { 90 return bindingTemplate; 91 } 92 93 97 public void add (BindingTemplate b) { 98 bindingTemplate.add (b); 99 } 100 101 107 public boolean remove (BindingTemplate b) { 108 return bindingTemplate.remove (b); 109 } 110 111 116 public BindingTemplate get (int index) { 117 return (BindingTemplate) bindingTemplate.get (index); 118 } 119 120 124 public int size () { 125 return bindingTemplate.size (); 126 } 127 128 137 public void saveToXML(Element parent) { 138 base = parent.getOwnerDocument().createElement(UDDI_TAG); 139 if (bindingTemplate!=null) { 141 for (int i=0; i < bindingTemplate.size(); i++) { 142 ((BindingTemplate)(bindingTemplate.elementAt(i))).saveToXML(base); 143 } 144 } 145 parent.appendChild(base); 146 } 147 } 148 | Popular Tags |