|
Openfire 3.5.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmpp.packet.PacketExtension
public class PacketExtension
A packet extension represents a child element of a Packet for a given qualified name. The PacketExtension acts as a wrapper on a child element the same way Packet does for a whole element. The wrapper provides an easy way to handle the packet extension.
Subclasses of this class can be registered using the static variable
registeredExtensions. The registration process associates the new subclass
with a given qualified name (ie. element name and namespace). This information will be used by
Packet.getExtension(String, String)
for locating the corresponding PacketExtension
subclass to return for the requested qualified name. Each PacketExtension must have a public
constructor that takes an Element instance as an argument.
Field Summary | |
---|---|
protected static org.dom4j.DocumentFactory |
docFactory
|
protected org.dom4j.Element |
element
|
protected static Map<org.dom4j.QName,Class> |
registeredExtensions
Subclasses of PacketExtension should register the element name and namespace that the subclass is using. |
Constructor Summary | |
---|---|
PacketExtension(org.dom4j.Element element)
Constructs a new PacketExtension. |
|
PacketExtension(String name,
String namespace)
Constructs a new Packet extension using the specified name and namespace. |
Method Summary | |
---|---|
PacketExtension |
createCopy()
Creates a deep copy of this packet extension. |
org.dom4j.Element |
getElement()
Returns the DOM4J Element that backs the packet. |
static Class |
getExtensionClass(String name,
String namespace)
Returns the extension class to use for the specified element name and namespace. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.dom4j.DocumentFactory docFactory
protected static Map<org.dom4j.QName,Class> registeredExtensions
protected org.dom4j.Element element
Constructor Detail |
---|
public PacketExtension(String name, String namespace)
name
- the child element name.namespace
- the child element namespace.public PacketExtension(org.dom4j.Element element)
element
- the XML Element that contains the packet extension contents.Method Detail |
---|
public static Class getExtensionClass(String name, String namespace)
name
- the child element name.namespace
- the child element namespace.
public org.dom4j.Element getElement()
public PacketExtension createCopy()
|
Openfire 3.5.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |