StandardExtensionElement
instead.@Deprecated public class DefaultExtensionElement extends Object implements ExtensionElement
ProviderManager
,
instances of this class will be returned when getting stanza extensions.This class provides a very simple representation of an XML sub-document. Each element is a key in a Map with its CDATA being the value. For example, given the following XML sub-document:
<foo xmlns="http://bar.com"> <color>blue</color> <food>pizza</food> </foo>In this case, getValue("color") would return "blue", and getValue("food") would return "pizza". This parsing mechanism is very simplistic and will not work as desired in all cases (for example, if some of the elements have attributes. In those cases, a custom ExtensionElementProvider should be used.
Constructor and Description |
---|
DefaultExtensionElement(String elementName,
String namespace)
Deprecated.
Creates a new generic stanza extension.
|
Modifier and Type | Method and Description |
---|---|
String |
getElementName()
Deprecated.
Returns the XML element name of the extension sub-packet root element.
|
Collection<String> |
getNames()
Deprecated.
Returns an unmodifiable collection of the names that can be used to get
values of the stanza extension.
|
String |
getNamespace()
Deprecated.
Returns the XML namespace of the extension sub-packet root element.
|
String |
getValue(String name)
Deprecated.
Returns a stanza extension value given a name.
|
void |
setValue(String name,
String value)
Deprecated.
Sets a stanza extension value using the given name.
|
CharSequence |
toXML(String enclosingNamespace)
Deprecated.
Returns the XML representation of this Element.
|
public DefaultExtensionElement(String elementName, String namespace)
elementName
- the name of the element of the XML sub-document.namespace
- the namespace of the element.public String getElementName()
getElementName
in interface NamedElement
public String getNamespace()
getNamespace
in interface ExtensionElement
public CharSequence toXML(String enclosingNamespace)
Element
public Collection<String> getNames()
public String getValue(String name)
name
- the name.