@NotThreadSafe public class PacketExtension extends Object
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.
| Modifier and Type | Field and Description |
|---|---|
protected static org.dom4j.DocumentFactory |
docFactory |
protected org.dom4j.Element |
element |
protected static Map<org.dom4j.QName,Class<? extends PacketExtension>> |
registeredExtensions
Subclasses of PacketExtension should register the element name and namespace that the
subclass is using.
|
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
PacketExtension |
createCopy()
Creates a deep copy of this packet extension.
|
org.dom4j.Element |
getElement()
Returns the DOM4J Element that backs the packet.
|
static Class<? extends PacketExtension> |
getExtensionClass(String name,
String namespace)
Returns the extension class to use for the specified element name and namespace.
|
protected static final org.dom4j.DocumentFactory docFactory
protected static final Map<org.dom4j.QName,Class<? extends PacketExtension>> registeredExtensions
protected org.dom4j.Element element
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.public static Class<? extends PacketExtension> getExtensionClass(String name, String namespace)
name - the child element name.namespace - the child element namespace.public org.dom4j.Element getElement()
public PacketExtension createCopy()
Copyright © 2009–2017 Ignite Realtime. All rights reserved.