Package org.jivesoftware.smack.provider
package org.jivesoftware.smack.provider
The Smack provider architecture is a system for plugging in custom XML parsing of stanza extensions
(
ExtensionElement, IQ stanzas and
Nonza. Hence, there are the the following providers:
For most users, only extension element and IQ providers should be relevant.
Architecture
Providers are registered with the ProviderManager. XML elements identified by their
QName, that is, their qualified name consistent of the XML elements name and its
namespace. The QName is hence used to map XML elements to their provider Whenever a stanza extension is found in a
stanza, parsing will be passed to the correct provider. Each provider is responsible for parsing the XML stream via
Smack's XmlPullParser.
Unknown Extension Elements
If no extension element provider is registered for an element, then Smack will fall back to parse the "unknown"
element to a StandardExtensionElement.
Custom Provider Example
SeeIqProvider for examples.-
ClassDescriptionAbstractProvider<E extends Element>EmbeddedExtensionProvider<PE extends XmlElement>This class simplifies parsing of embedded elements by using the Template Method Pattern.ExtensionElementProvider<E extends XmlElement>An abstract class for parsing custom extensions elements.Defines the information required to register a stanza extension Provider with the
ProviderManagerwhen using theProviderLoader.Deprecated.use a proper parser.IntrospectionProvider.IQIntrospectionProvider<I extends IQ>Deprecated.use a proper parser.Deprecated.use a proper parser.IqProvider<I extends IQ>An abstract class for parsing customIQpackets.Defines the information required to register an IQ Provider with theProviderManagerwhen using theProviderLoader.LegacyIQProvider<I extends IQ>Deprecated.UseIqProviderinsteadNonzaProvider<N extends Nonza>Smack provider are the parsers used to deserialize raw XMPP into the according JavaElements.Loads theIqProviderandExtensionElementProviderinformation from a standard provider file in preparation for loading into theProviderManager.Used to load providers into theProviderManager.Manages providers for parsing custom XML sub-documents of XMPP packets.