public final class StandardExtensionElement extends Object implements ExtensionElement
ExtensionElement
modeling the often required and used XML features when using XMPP. It
is therefore suitable for most use cases. Use
builder(String, String)
to build these elements.
Note the this is only meant as catch-all if no particular extension element provider is registered. Protocol implementations should prefer to model their own extension elements tailored to their use cases.
Modifier and Type | Class and Description |
---|---|
static class |
StandardExtensionElement.Builder |
Constructor and Description |
---|
StandardExtensionElement(String name,
String namespace)
Constructs a new extension element with the given name and namespace and nothing else.
|
Modifier and Type | Method and Description |
---|---|
static StandardExtensionElement.Builder |
builder(String name,
String namespace) |
Map<String,String> |
getAttributes() |
String |
getAttributeValue(String attribute) |
String |
getElementName()
Returns the root element name.
|
List<StandardExtensionElement> |
getElements() |
List<StandardExtensionElement> |
getElements(String element) |
List<StandardExtensionElement> |
getElements(String element,
String namespace) |
StandardExtensionElement |
getFirstElement(String element) |
StandardExtensionElement |
getFirstElement(String element,
String namespace) |
String |
getNamespace()
Returns the root element XML namespace.
|
String |
getText() |
XmlStringBuilder |
toXML(String enclosingNamespace)
Returns the XML representation of this Element.
|
public StandardExtensionElement(String name, String namespace)
This is meant to construct extension elements used as simple flags in Stanzas.
name
- the name of the extension element.namespace
- the namespace of the extension element.public String getElementName()
NamedElement
getElementName
in interface NamedElement
public String getNamespace()
ExtensionElement
getNamespace
in interface ExtensionElement
public String getAttributeValue(String attribute)
public Map<String,String> getAttributes()
public StandardExtensionElement getFirstElement(String element, String namespace)
public StandardExtensionElement getFirstElement(String element)
public List<StandardExtensionElement> getElements(String element, String namespace)
public List<StandardExtensionElement> getElements(String element)
public List<StandardExtensionElement> getElements()
public XmlStringBuilder toXML(String enclosingNamespace)
Element
public static StandardExtensionElement.Builder builder(String name, String namespace)