1 8 9 package org.uddi4j.response; 10 11 import org.uddi4j.UDDIElement; 12 import org.uddi4j.UDDIException; 13 import org.w3c.dom.Element ; 14 import org.w3c.dom.NodeList ; 15 16 40 public class BusinessList extends UDDIElement { 41 public static final String UDDI_TAG = "businessList"; 42 43 protected Element base = null; 44 45 String operator = null; 46 String truncated = null; BusinessInfos businessInfos = null; 48 49 55 56 public BusinessList() { 57 } 58 59 65 public BusinessList(String operator, 66 BusinessInfos businessInfos) { 67 this.operator = operator; 68 this.businessInfos = businessInfos; 69 } 70 71 81 82 public BusinessList(Element base) throws UDDIException { 83 super(base); 85 operator = base.getAttribute("operator"); 86 truncated = base.getAttribute("truncated"); 87 NodeList nl = null; 88 nl = getChildElementsByTagName(base, BusinessInfos.UDDI_TAG); 89 if (nl.getLength() > 0) { 90 businessInfos = new BusinessInfos((Element)nl.item(0)); 91 } 92 } 93 94 public void setOperator(String s) { 95 operator = s; 96 } 97 98 public void setTruncated(String s) { 99 truncated = s; 100 } 101 public void setTruncated(boolean s) { 102 if (s) { 103 truncated = "true"; 104 } else { 105 truncated = "false"; 106 } 107 } 108 109 public void setBusinessInfos(BusinessInfos s) { 110 businessInfos = s; 111 } 112 113 public String getOperator() { 114 return operator; 115 } 116 117 118 public String getTruncated() { 119 return truncated; 120 } 121 122 public boolean getTruncatedBoolean() { 123 return "true".equals(truncated); 124 } 125 126 public BusinessInfos getBusinessInfos() { 127 return businessInfos; 128 } 129 130 131 140 141 public void saveToXML(Element parent) { 142 base = parent.getOwnerDocument().createElement(UDDI_TAG); 143 base.setAttribute("generic", UDDIElement.GENERIC); 145 base.setAttribute("xmlns", UDDIElement.XMLNS); 146 if (operator!=null) { 147 base.setAttribute("operator", operator); 148 } 149 if (truncated!=null) { 150 base.setAttribute("truncated", truncated); 151 } 152 if (businessInfos!=null) { 153 businessInfos.saveToXML(base); 154 } 155 parent.appendChild(base); 156 } 157 } 158 | Popular Tags |