Package org.jivesoftware.smack.packet
Class StandardExtensionElement
- java.lang.Object
-
- org.jivesoftware.smack.packet.StandardExtensionElement
-
- All Implemented Interfaces:
Element
,ExtensionElement
,FullyQualifiedElement
,NamedElement
,XmlLangElement
public final class StandardExtensionElement extends java.lang.Object implements ExtensionElement
AnExtensionElement
modeling the often required and used XML features when using XMPP. It is therefore suitable for most use cases. Usebuilder(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.
- Since:
- 4.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StandardExtensionElement.Builder
-
Constructor Summary
Constructors Constructor Description StandardExtensionElement(java.lang.String name, java.lang.String namespace)
Constructs a new extension element with the given name and namespace and nothing else.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StandardExtensionElement.Builder
builder(java.lang.String name, java.lang.String namespace)
java.util.Map<java.lang.String,java.lang.String>
getAttributes()
java.lang.String
getAttributeValue(java.lang.String attribute)
java.lang.String
getElementName()
Returns the root element name.java.util.List<StandardExtensionElement>
getElements()
java.util.List<StandardExtensionElement>
getElements(java.lang.String element)
java.util.List<StandardExtensionElement>
getElements(java.lang.String element, java.lang.String namespace)
StandardExtensionElement
getFirstElement(java.lang.String element)
StandardExtensionElement
getFirstElement(java.lang.String element, java.lang.String namespace)
java.lang.String
getNamespace()
Returns the root element XML namespace.java.lang.String
getText()
XmlStringBuilder
toXML(XmlEnvironment enclosingNamespace)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Constructor Detail
-
StandardExtensionElement
public StandardExtensionElement(java.lang.String name, java.lang.String namespace)
Constructs a new extension element with the given name and namespace and nothing else.This is meant to construct extension elements used as simple flags in Stanzas.
- Parameters:
name
- the name of the extension element.namespace
- the namespace of the extension element.
-
-
Method Detail
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
getAttributeValue
public java.lang.String getAttributeValue(java.lang.String attribute)
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
-
getFirstElement
public StandardExtensionElement getFirstElement(java.lang.String element, java.lang.String namespace)
-
getFirstElement
public StandardExtensionElement getFirstElement(java.lang.String element)
-
getElements
public java.util.List<StandardExtensionElement> getElements(java.lang.String element, java.lang.String namespace)
-
getElements
public java.util.List<StandardExtensionElement> getElements(java.lang.String element)
-
getElements
public java.util.List<StandardExtensionElement> getElements()
-
getText
public java.lang.String getText()
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
builder
public static StandardExtensionElement.Builder builder(java.lang.String name, java.lang.String namespace)
-
-