@Override public Open parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException { String sessionID = parser.getAttributeValue("", "sid"); int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size")); String stanzaValue = parser.getAttributeValue("", "stanza"); StanzaType stanza; if (stanzaValue == null) { stanza = StanzaType.IQ; } else { stanza = StanzaType.valueOf(stanzaValue.toUpperCase(Locale.US)); } parser.next(); return new Open(sessionID, blockSize, stanza); }
public IQ parseIQ(XmlPullParser parser) throws Exception { String sessionID = parser.getAttributeValue("", "sid"); int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size")); String stanzaValue = parser.getAttributeValue("", "stanza"); StanzaType stanza = null; if (stanzaValue == null) { stanza = StanzaType.IQ; } else { stanza = StanzaType.valueOf(stanzaValue.toUpperCase()); } return new Open(sessionID, blockSize, stanza); }
public IQ parseIQ(XmlPullParser parser) throws Exception { String sessionID = parser.getAttributeValue("", "sid"); int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size")); String stanzaValue = parser.getAttributeValue("", "stanza"); StanzaType stanza = null; if (stanzaValue == null) { stanza = StanzaType.IQ; } else { stanza = StanzaType.valueOf(stanzaValue.toUpperCase()); } return new Open(sessionID, blockSize, stanza); }
public IQ parseIQ(XmlPullParser parser) throws Exception { String sessionID = parser.getAttributeValue("", "sid"); int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size")); String stanzaValue = parser.getAttributeValue("", "stanza"); StanzaType stanza = null; if (stanzaValue == null) { stanza = StanzaType.IQ; } else { stanza = StanzaType.valueOf(stanzaValue.toUpperCase()); } return new Open(sessionID, blockSize, stanza); }