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 RegisteredInfo extends UDDIElement { 41 public static final String UDDI_TAG = "registeredInfo"; 42 43 protected Element base = null; 44 45 String operator = null; 46 String truncated = null; 47 BusinessInfos businessInfos = null; 48 TModelInfos tModelInfos = null; 49 50 56 57 public RegisteredInfo() { 58 } 59 60 67 public RegisteredInfo(String operator, 68 BusinessInfos businessInfos, 69 TModelInfos tModelInfos) { 70 this.operator = operator; 71 this.businessInfos = businessInfos; 72 this.tModelInfos = tModelInfos; 73 } 74 75 85 86 public RegisteredInfo(Element base) throws UDDIException { 87 super(base); 89 operator = base.getAttribute("operator"); 90 truncated = base.getAttribute("truncated"); 91 NodeList nl = null; 92 nl = getChildElementsByTagName(base, BusinessInfos.UDDI_TAG); 93 if (nl.getLength() > 0) { 94 businessInfos = new BusinessInfos((Element)nl.item(0)); 95 } 96 nl = getChildElementsByTagName(base, TModelInfos.UDDI_TAG); 97 if (nl.getLength() > 0) { 98 tModelInfos = new TModelInfos((Element)nl.item(0)); 99 } 100 } 101 102 public void setOperator(String s) { 103 operator = s; 104 } 105 106 public void setTruncated(String s) { 107 truncated = s; 108 } 109 public void setTruncated(boolean s) { 110 if (s) { 111 truncated = "true"; 112 } else { 113 truncated = "false"; 114 } 115 } 116 117 public void setBusinessInfos(BusinessInfos s) { 118 businessInfos = s; 119 } 120 121 public void setTModelInfos(TModelInfos s) { 122 tModelInfos = s; 123 } 124 125 public String getOperator() { 126 return operator; 127 } 128 129 130 public String getTruncated() { 131 return truncated; 132 } 133 134 public boolean getTruncatedBoolean() { 135 return "true".equals(truncated); 136 } 137 138 public BusinessInfos getBusinessInfos() { 139 return businessInfos; 140 } 141 142 143 public TModelInfos getTModelInfos() { 144 return tModelInfos; 145 } 146 147 148 157 158 public void saveToXML(Element parent) { 159 base = parent.getOwnerDocument().createElement(UDDI_TAG); 160 base.setAttribute("generic", UDDIElement.GENERIC); 162 base.setAttribute("xmlns", UDDIElement.XMLNS); 163 if (operator!=null) { 164 base.setAttribute("operator", operator); 165 } 166 if (truncated!=null) { 167 base.setAttribute("truncated", truncated); 168 } 169 if (businessInfos!=null) { 170 businessInfos.saveToXML(base); 171 } 172 if (tModelInfos!=null) { 173 tModelInfos.saveToXML(base); 174 } 175 parent.appendChild(base); 176 } 177 } 178 | Popular Tags |