Java 类org.jivesoftware.smack.parsing.UnparsablePacket 实例源码

项目:Smack    文件:AbstractXMPPConnection.java   
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);
        UnparsablePacket message = new UnparsablePacket(content, e);
        ParsingExceptionCallback callback = getParsingExceptionCallback();
        if (callback != null) {
            callback.handleUnparsablePacket(message);
        }
    }
    ParserUtils.assertAtEndTag(parser);
    if (stanza != null) {
        processPacket(stanza);
    }
}