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 38 public class Result extends UDDIElement { 39 public static final String UDDI_TAG = "result"; 40 41 protected Element base = null; 42 43 String keyType = null; 44 String errno = null; 45 ErrInfo errInfo = null; 46 47 53 54 public Result() { 55 } 56 57 62 public Result(String errno) { 63 this.errno = errno; 64 } 65 66 76 77 public Result(Element base) throws UDDIException { 78 super(base); 80 keyType = base.getAttribute("keyType"); 81 errno = base.getAttribute("errno"); 82 NodeList nl = null; 83 nl = getChildElementsByTagName(base, ErrInfo.UDDI_TAG); 84 if( nl.getLength() > 0 ) { 85 errInfo = new ErrInfo((Element)nl.item(0)); 86 } 87 } 88 89 public void setKeyType(String s) { 90 keyType = s; 91 } 92 93 public void setErrno(String s) { 94 errno = s; 95 } 96 97 public void setErrInfo(ErrInfo s) { 98 errInfo = s; 99 } 100 101 public String getKeyType() { 102 return keyType; 103 } 104 105 public String getErrno() { 106 return errno; 107 } 108 109 public ErrInfo getErrInfo() { 110 return errInfo; 111 } 112 113 122 123 public void saveToXML(Element parent) { 124 base = parent.getOwnerDocument().createElement(UDDI_TAG); 125 if (keyType!=null) { 127 base.setAttribute("keyType", keyType); 128 } 129 if (errno!=null) { 130 base.setAttribute("errno", errno); 131 } 132 if (errInfo!=null) { 133 errInfo.saveToXML(base); 134 } 135 parent.appendChild(base); 136 } 137 } 138 | Popular Tags |