1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-11 23:51:09 +01:00

Rework Smack Provider design

this is the first stop towards fixing "SMACK-65: parsing should look for
depth", by providing the initial parsing depth to the provider. Some
methods (.e.g parseMessage) now use the depth as abort condition,
instead of a unclean String equals check.

parseIQ() and parseExtension() where both renamed to parse.

This also restricts the Exceptions thrown by the parse method, to just
XmlPullParserException, IOException and SmackException (not really a big
victory, but nevertheless a slight improvement).

StreamFeatureProvider is now gone, we simply use PacketExtensionProvider
for stream features.
This commit is contained in:
Florian Schmaus 2014-10-07 21:15:20 +02:00
parent d04517cd08
commit 6980c8e63d
137 changed files with 1101 additions and 841 deletions

View file

@ -80,17 +80,10 @@ public class AttentionExtension implements PacketExtension {
*
* @author Guus der Kinderen, guus.der.kinderen@gmail.com
s */
public static class Provider implements PacketExtensionProvider {
public static class Provider extends PacketExtensionProvider<AttentionExtension> {
/*
* (non-Javadoc)
*
* @see
* org.jivesoftware.smack.provider.PacketExtensionProvider#parseExtension
* (org.xmlpull.v1.XmlPullParser)
*/
public PacketExtension parseExtension(XmlPullParser arg0)
throws Exception {
@Override
public AttentionExtension parse(XmlPullParser parser, int initialDepth) {
return new AttentionExtension();
}
}