()
| 178 | } |
| 179 | |
| 180 | public JabberDataBlock construct() { |
| 181 | if (errCondition==NONE) return null; |
| 182 | JabberDataBlock error=new JabberDataBlock("error"); |
| 183 | String type=null; |
| 184 | switch (errorType) { |
| 185 | case TYPE_MODIFY: type="modify"; break; |
| 186 | case TYPE_CANCEL: type="cancel"; break; |
| 187 | case TYPE_AUTH: type="auth"; break; |
| 188 | case TYPE_WAIT: type="wait"; break; |
| 189 | default: /*case TYPE_UNDEFINED:*/ type="cancel"; break; |
| 190 | } |
| 191 | error.setAttribute("type", type); |
| 192 | |
| 193 | error.addChildNs(textCondition, "urn:ietf:params:xml:ns:xmpp-stanzas"); |
| 194 | if (text!=null) error.addChildNs("text", "urn:ietf:params:xml:ns:xmpp-stanzas").setText(text); |
| 195 | |
| 196 | return error; |
| 197 | } |
| 198 | |
| 199 | public static XmppError findInStanza(JabberDataBlock stanza) { |
| 200 | XmppError err = decodeStanzaError(stanza.getChildBlock("error")); |
no test coverage detected