MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / construct

Method construct

src/main/java/xmpp/XmppError.java:180–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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"));

Callers 2

acceptMethod · 0.80
dispatchXmppStanzaMethod · 0.80

Calls 3

setAttributeMethod · 0.95
addChildNsMethod · 0.95
setTextMethod · 0.45

Tested by

no test coverage detected