public static AckRequest ackRequest(XmlPullParser parser) throws XmlPullParserException, IOException { ParserUtils.assertAtStartTag(parser); parser.next(); ParserUtils.assertAtEndTag(parser); return AckRequest.INSTANCE; } }
public static Resumed resumed(XmlPullParser parser) throws XmlPullParserException, IOException { ParserUtils.assertAtStartTag(parser); long h = ParserUtils.getLongAttribute(parser, "h"); String previd = parser.getAttributeValue("", "previd"); parser.next(); ParserUtils.assertAtEndTag(parser); return new Resumed(h, previd); }
public static Enabled enabled(XmlPullParser parser) throws XmlPullParserException, IOException { ParserUtils.assertAtStartTag(parser); boolean resume = ParserUtils.getBooleanAttribute(parser, "resume", false); String id = parser.getAttributeValue("", "id"); String location = parser.getAttributeValue("", "location"); int max = ParserUtils.getIntegerAttribute(parser, "max", -1); parser.next(); ParserUtils.assertAtEndTag(parser); return new Enabled(id, resume, location, max); }
public static AckAnswer ackAnswer(XmlPullParser parser) throws XmlPullParserException, IOException { ParserUtils.assertAtStartTag(parser); long h = ParserUtils.getLongAttribute(parser, "h"); parser.next(); ParserUtils.assertAtEndTag(parser); return new AckAnswer(h); }
ParserUtils.assertAtEndTag(parser); return object;
ParserUtils.assertAtEndTag(parser); return new Failed(condition, textElements);
ParserUtils.assertAtEndTag(parser); assert (item != null); return item;
ParserUtils.assertAtEndTag(parser); return builder.build();
protected void parseAndProcessStanza(XmlPullParser parser) throws Exception { ParserUtils.assertAtStartTag(parser); int parserDepth = parser.getDepth(); Stanza stanza = null; try { stanza = PacketParserUtils.parseStanza(parser); } catch (Exception e) { CharSequence content = PacketParserUtils.parseContentDepth(parser, parserDepth); UnparseableStanza message = new UnparseableStanza(content, e); ParsingExceptionCallback callback = getParsingExceptionCallback(); if (callback != null) { callback.handleUnparsableStanza(message); } } ParserUtils.assertAtEndTag(parser); if (stanza != null) { processStanza(stanza); } }
ParserUtils.assertAtEndTag(parser); return object;
@Override protected void parseAndProcessStanza(XmlPullParser parser) throws Exception { ParserUtils.assertAtStartTag(parser); int parserDepth = parser.getDepth(); Stanza stanza = null; try { if (IQ.IQ_ELEMENT.equals(parser.getName()) && parser.getAttributeValue("", "type") == null) { // Acknowledgement IQs don't contain a type so an empty result is created here to prevent a parsing NPE stanza = new EmptyResultIQ(); } else { stanza = PacketParserUtils.parseStanza(parser); } } catch (Exception e) { CharSequence content = PacketParserUtils.parseContentDepth(parser, parserDepth); logger.warn("Smack message parsing exception. Content: '{}'", content, e); } ParserUtils.assertAtEndTag(parser); if (stanza != null) { processStanza(stanza); } }
ParserUtils.assertAtEndTag(parser); assert (item != null); return item;
ParserUtils.assertAtEndTag(parser); return builder.build();
protected void parseAndProcessStanza(XmlPullParser parser) throws Exception { ParserUtils.assertAtStartTag(parser); int parserDepth = parser.getDepth(); Stanza stanza = null; try { stanza = PacketParserUtils.parseStanza(parser); } catch (Exception e) { CharSequence content = PacketParserUtils.parseContentDepth(parser, parserDepth); UnparseableStanza message = new UnparseableStanza(content, e); ParsingExceptionCallback callback = getParsingExceptionCallback(); if (callback != null) { callback.handleUnparsableStanza(message); } } ParserUtils.assertAtEndTag(parser); if (stanza != null) { processStanza(stanza); } }