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 42 public class RelatedBusinessInfos extends UDDIElement { 43 44 public static final String UDDI_TAG = "relatedBusinessInfos"; 45 46 protected Element base = null; 47 48 Vector relatedBusinessInfo = new Vector (); 50 51 57 58 public RelatedBusinessInfos() { 59 } 60 61 62 72 73 public RelatedBusinessInfos(Element base) throws UDDIException { 74 super(base); 76 NodeList nl = null; 77 nl = getChildElementsByTagName(base, RelatedBusinessInfo.UDDI_TAG); 78 for (int i=0; i < nl.getLength(); i++) { 79 relatedBusinessInfo.addElement(new RelatedBusinessInfo((Element)nl.item(i))); 80 } 81 } 82 83 88 public RelatedBusinessInfos(Vector relatedBusinessInfo) { 89 this.relatedBusinessInfo = relatedBusinessInfo; 90 } 91 92 public Vector getRelatedBusinessInfoVector() { 93 return this.relatedBusinessInfo; 94 } 95 96 public void setRelatedBusinessInfoVector(Vector relatedBusinessInfo) { 97 this.relatedBusinessInfo = relatedBusinessInfo; 98 } 99 100 104 public void add (RelatedBusinessInfo r) { 105 relatedBusinessInfo.add (r); 106 } 107 108 114 public boolean remove (RelatedBusinessInfo r) { 115 return relatedBusinessInfo.remove (r); 116 } 117 118 123 public RelatedBusinessInfo get (int index) { 124 return (RelatedBusinessInfo) relatedBusinessInfo.get (index); 125 } 126 127 131 public int size () { 132 return relatedBusinessInfo.size (); 133 } 134 135 144 145 public void saveToXML(Element parent) { 146 base = parent.getOwnerDocument().createElement(UDDI_TAG); 147 if (relatedBusinessInfo!=null) { 149 for (int i=0; i < relatedBusinessInfo.size(); i++) { 150 ((RelatedBusinessInfo)(relatedBusinessInfo.elementAt(i))).saveToXML(base); 151 } 152 } 153 parent.appendChild(base); 154 155 } 156 } 157 | Popular Tags |