1 8 9 package org.uddi4j.request; 10 11 import java.util.Vector ; 12 13 import org.uddi4j.UDDIElement; 14 import org.uddi4j.UDDIException; 15 import org.uddi4j.util.BusinessKey; 16 import org.w3c.dom.Element ; 17 import org.w3c.dom.NodeList ; 18 19 43 public class GetBusinessDetailExt extends UDDIElement { 44 public static final String UDDI_TAG = "get_businessDetailExt"; 45 46 protected Element base = null; 47 48 Vector businessKey = new Vector (); 50 51 57 public GetBusinessDetailExt() { 58 } 59 60 65 public GetBusinessDetailExt(Vector businessKeyStrings) { 66 Vector objects; 67 objects = new Vector (); 68 for (int i = 0; i < businessKeyStrings.size(); i++) { 69 objects.addElement( new BusinessKey((String )businessKeyStrings.elementAt(i)) ); 70 } 71 72 this.businessKey = objects; 73 } 74 75 85 public GetBusinessDetailExt(Element base) throws UDDIException { 86 super(base); 88 NodeList nl = null; 89 nl = getChildElementsByTagName(base, BusinessKey.UDDI_TAG); 90 for (int i=0; i < nl.getLength(); i++) { 91 businessKey.addElement(new BusinessKey((Element)nl.item(i))); 92 } 93 } 94 95 100 public void setBusinessKeyVector(Vector s) { 101 businessKey = s; 102 } 103 104 109 public void setBusinessKeyStrings(Vector s) { 110 businessKey = new Vector (); 111 for (int i = 0; i < s.size(); i++) { 112 businessKey.addElement( new BusinessKey((String )s.elementAt(i)) ); 113 } 114 } 115 116 121 public Vector getBusinessKeyVector() { 122 return businessKey; 123 } 124 125 130 public Vector getBusinessKeyStrings() { 131 Vector strings = new Vector (); 132 for (int i = 0; i < businessKey.size(); i++) { 133 strings.addElement( ((BusinessKey)businessKey.elementAt(i)).getText()); 134 } 135 return strings; 136 } 137 138 147 public void saveToXML(Element parent) { 148 base = parent.getOwnerDocument().createElement(UDDI_TAG); 149 base.setAttribute("generic", UDDIElement.GENERIC); 151 base.setAttribute("xmlns", UDDIElement.XMLNS); 152 if (businessKey!=null) { 153 for (int i=0; i < businessKey.size(); i++) { 154 ((BusinessKey)(businessKey.elementAt(i))).saveToXML(base); 155 } 156 } 157 parent.appendChild(base); 158 } 159 } 160 | Popular Tags |