1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-10 07:01:07 +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

@ -52,7 +52,7 @@ public class CarbonTest extends ExperimentalInitializerTest {
.asString(outputProperties);
parser = PacketParserUtils.getParserFor(control);
cc = (CarbonExtension) new CarbonManagerProvider().parseExtension(parser);
cc = (CarbonExtension) new CarbonManagerProvider().parse(parser);
fwd = cc.getForwarded();
// meta
@ -83,7 +83,7 @@ public class CarbonTest extends ExperimentalInitializerTest {
.asString(outputProperties);
parser = PacketParserUtils.getParserFor(control);
cc = (CarbonExtension) new CarbonManagerProvider().parseExtension(parser);
cc = (CarbonExtension) new CarbonManagerProvider().parse(parser);
assertEquals(CarbonExtension.Direction.received, cc.getDirection());
@ -102,6 +102,6 @@ public class CarbonTest extends ExperimentalInitializerTest {
.asString(outputProperties);
parser = PacketParserUtils.getParserFor(control);
new CarbonManagerProvider().parseExtension(parser);
new CarbonManagerProvider().parse(parser);
}
}