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.TModelKey; 16 import org.w3c.dom.Element ; 17 import org.w3c.dom.NodeList ; 18 19 42 public class GetTModelDetail extends UDDIElement { 43 public static final String UDDI_TAG = "get_tModelDetail"; 44 45 protected Element base = null; 46 47 Vector tModelKey = new Vector (); 49 50 56 public GetTModelDetail() { 57 } 58 59 64 public GetTModelDetail(Vector tModelKeyStrings) { 65 Vector objects; 66 objects = new Vector (); 67 for (int i = 0; i < tModelKeyStrings.size(); i++) { 68 objects.addElement( new TModelKey((String )tModelKeyStrings.elementAt(i)) ); 69 } 70 71 this.tModelKey = objects; 72 } 73 74 84 public GetTModelDetail(Element base) throws UDDIException { 85 super(base); 87 NodeList nl = null; 88 nl = getChildElementsByTagName(base, TModelKey.UDDI_TAG); 89 for (int i=0; i < nl.getLength(); i++) { 90 tModelKey.addElement(new TModelKey((Element)nl.item(i))); 91 } 92 } 93 94 99 public void setTModelKeyVector(Vector s) { 100 tModelKey = s; 101 } 102 103 108 public void setTModelKeyStrings(Vector s) { 109 tModelKey = new Vector (); 110 for (int i = 0; i < s.size(); i++) { 111 tModelKey.addElement( new TModelKey((String )s.elementAt(i)) ); 112 } 113 } 114 115 120 public Vector getTModelKeyVector() { 121 return tModelKey; 122 } 123 124 129 public Vector getTModelKeyStrings() { 130 Vector strings = new Vector (); 131 for (int i = 0; i < tModelKey.size(); i++) { 132 strings.addElement( ((TModelKey)tModelKey.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 (tModelKey!=null) { 152 for (int i=0; i < tModelKey.size(); i++) { 153 ((TModelKey)(tModelKey.elementAt(i))).saveToXML(base); 154 } 155 } 156 parent.appendChild(base); 157 } 158 } 159 | Popular Tags |