mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-26 12:37:58 +01:00
Fixed Javadocs for extension providers.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1944 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
1ed6ab1e40
commit
7f8756d5a0
1 changed files with 16 additions and 11 deletions
|
@ -111,25 +111,30 @@ import java.net.URL;
|
|||
* value from the XML into a boolean, int, long, float, double, or Class depending on the
|
||||
* type the IQ instance expects.<p>
|
||||
*
|
||||
* A pluggable system for the <x> portion of packets also exists. Each x provider
|
||||
* A pluggable system for packet extensions, child elements in a custom namespace for
|
||||
* message and presence packets, also exists. Each extension provider
|
||||
* is registered with a name space in the smack.providers file as in the following example:
|
||||
*
|
||||
* <pre>
|
||||
* <?xml version="1.0"?>
|
||||
* <smackProviders>
|
||||
* <xProvider namespace="jabber:iq:event"
|
||||
* className="org.jivesoftware.smack.packet.MessageEvent"/>
|
||||
* <extensionProvider>
|
||||
* <elementName>x</elementName>
|
||||
* <namespace>jabber:iq:event</namespace>
|
||||
* <className>org.jivesoftware.smack.packet.MessageEvent</className>
|
||||
* </extensionProvider>
|
||||
* </smackProviders></pre>
|
||||
*
|
||||
* If multiple provider entries attempt to register to handle the same namespace, the
|
||||
* first entry loaded from the classpath will take precedence. Whenever an <x> element
|
||||
* If multiple provider entries attempt to register to handle the same element name and namespace,
|
||||
* the first entry loaded from the classpath will take precedence. Whenever a packet extension
|
||||
* is found in a packet, parsing will be passed to the correct provider. Each provider
|
||||
* can either implement the XProvider or be a standard Java Bean. In the former case,
|
||||
* each XProvider is responsible for parsing the raw XML stream to contruct an object.
|
||||
* In the latter case, bean introspection is used to try to automatically set the
|
||||
* properties of the class using the values in the x sub-element. When a XProvider is
|
||||
* not registered for a namespace, Smack will store all top-level elements of the sub-packet
|
||||
* in a Map and attach it to the packet.
|
||||
* can either implement the PacketExtensionProvider interface or be a standard Java Bean. In
|
||||
* the former case, each extension provider is responsible for parsing the raw XML stream to
|
||||
* contruct an object. In the latter case, bean introspection is used to try to automatically
|
||||
* set the properties of the class using the values in the packet extension sub-element. When an
|
||||
* extension provider is not registered for an element name and namespace combination, Smack will
|
||||
* store all top-level elements of the sub-packet in DefaultPacketExtension object and then
|
||||
* attach it to the packet.
|
||||
*
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue