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 TModelList extends UDDIElement { 41 public static final String UDDI_TAG = "tModelList"; 42 43 protected Element base = null; 44 45 String operator = null; 46 String truncated = null; 47 TModelInfos tModelInfos = null; 48 49 55 56 public TModelList() { 57 } 58 59 65 public TModelList(String operator, 66 TModelInfos tModelInfos) { 67 this.operator = operator; 68 this.tModelInfos = tModelInfos; 69 } 70 71 81 82 public TModelList(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, TModelInfos.UDDI_TAG); 89 if (nl.getLength() > 0) { 90 tModelInfos = new TModelInfos((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 setTModelInfos(TModelInfos s) { 110 tModelInfos = 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 TModelInfos getTModelInfos() { 127 return tModelInfos; 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 (tModelInfos!=null) { 153 tModelInfos.saveToXML(base); 154 } 155 parent.appendChild(base); 156 } 157 } 158 | Popular Tags |