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 42 public class GetBusinessDetail extends UDDIElement { 43 public static final String UDDI_TAG = "get_businessDetail"; 44 45 protected Element base = null; 46 47 Vector businessKey = new Vector (); 49 50 56 public GetBusinessDetail() { 57 } 58 59 64 public GetBusinessDetail(Vector businessKeyStrings) { 65 Vector objects; 66 objects = new Vector (); 67 for (int i = 0; i < businessKeyStrings.size(); i++) { 68 objects.addElement( new BusinessKey((String )businessKeyStrings.elementAt(i)) ); 69 } 70 71 this.businessKey = objects; 72 } 73 74 84 public GetBusinessDetail(Element base) throws UDDIException { 85 super(base); 87 NodeList nl = null; 88 nl = getChildElementsByTagName(base, BusinessKey.UDDI_TAG); 89 for (int i=0; i < nl.getLength(); i++) { 90 businessKey.addElement(new BusinessKey((Element)nl.item(i))); 91 } 92 } 93 94 99 public void setBusinessKeyVector(Vector s) { 100 businessKey = s; 101 } 102 103 108 public void setBusinessKeyStrings(Vector s) { 109 businessKey = new Vector (); 110 for (int i = 0; i < s.size(); i++) { 111 businessKey.addElement( new BusinessKey((String )s.elementAt(i)) ); 112 } 113 } 114 115 120 public Vector getBusinessKeyVector() { 121 return businessKey; 122 } 123 124 129 public Vector getBusinessKeyStrings() { 130 Vector strings = new Vector (); 131 for (int i = 0; i < businessKey.size(); i++) { 132 strings.addElement( ((BusinessKey)businessKey.elementAt(i)).getText()); 133 } 134 return strings; 135 } 136 137 146 public void saveToXML(Element parent) { 147 base = parent.getOwnerDocument().createElement(UDDI_TAG); 148 base.setAttribute("generic", UDDIElement.GENERIC); 150 base.setAttribute("xmlns", UDDIElement.XMLNS); 151 if (businessKey!=null) { 152 for (int i=0; i < businessKey.size(); i++) { 153 ((BusinessKey)(businessKey.elementAt(i))).saveToXML(base); 154 } 155 } 156 parent.appendChild(base); 157 } 158 } 159 | Popular Tags |