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 43 public class BusinessDetailExt extends UDDIElement 44 { 45 public static final String UDDI_TAG = "businessDetailExt"; 46 47 protected Element base = null; 48 49 String operator = null; 50 String truncated = null; 51 Vector businessEntityExt = new Vector (); 53 54 60 61 public BusinessDetailExt() 62 { 63 } 64 65 71 public BusinessDetailExt(String operator, Vector businessEntityExt) 72 { 73 this.operator = operator; 74 this.businessEntityExt = businessEntityExt; 75 } 76 77 87 88 public BusinessDetailExt(Element base) throws UDDIException 89 { 90 super(base); 92 operator = base.getAttribute("operator"); 93 truncated = base.getAttribute("truncated"); 94 NodeList nl = null; 95 nl = getChildElementsByTagName(base, BusinessEntityExt.UDDI_TAG); 96 for (int i = 0; i < nl.getLength(); i++) 97 { 98 businessEntityExt.addElement(new BusinessEntityExt((Element)nl.item(i))); 99 } 100 } 101 102 public void setOperator(String s) 103 { 104 operator = s; 105 } 106 107 public void setTruncated(String s) 108 { 109 truncated = s; 110 } 111 public void setTruncated(boolean s) 112 { 113 if (s) 114 { 115 truncated = "true"; 116 } 117 else 118 { 119 truncated = "false"; 120 } 121 } 122 123 128 public void setBusinessEntityExtVector(Vector s) 129 { 130 businessEntityExt = s; 131 } 132 133 public String getOperator() 134 { 135 return operator; 136 } 137 138 public String getTruncated() 139 { 140 return truncated; 141 } 142 143 public boolean getTruncatedBoolean() 144 { 145 return "true".equals(truncated); 146 } 147 148 153 public Vector getBusinessEntityExtVector() 154 { 155 return businessEntityExt; 156 } 157 158 167 168 public void saveToXML(Element parent) 169 { 170 base = parent.getOwnerDocument().createElement(UDDI_TAG); 171 base.setAttribute("generic", UDDIElement.GENERIC); 173 base.setAttribute("xmlns", UDDIElement.XMLNS); 174 if (operator != null) 175 { 176 base.setAttribute("operator", operator); 177 } 178 if (truncated != null) 179 { 180 base.setAttribute("truncated", truncated); 181 } 182 if (businessEntityExt != null) 183 { 184 for (int i = 0; i < businessEntityExt.size(); i++) 185 { 186 ((BusinessEntityExt) (businessEntityExt.elementAt(i))).saveToXML(base); 187 } 188 } 189 parent.appendChild(base); 190 } 191 } 192 | Popular Tags |