Package org.jivesoftware.smack.packet
Class StandardExtensionElement
- java.lang.Object
-
- org.jivesoftware.smack.packet.StandardExtensionElement
-
- All Implemented Interfaces:
Element
,NamedElement
,XmlElement
,XmlLangElement
public final class StandardExtensionElement extends Object implements XmlElement
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(String name, 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(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(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.XmlElement
getLanguage, getQName
-
-
-
-
Constructor Detail
-
StandardExtensionElement
public StandardExtensionElement(String name, 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 String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public String getNamespace()
Description copied from interface:XmlElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceXmlElement
- Returns:
- the namespace.
-
getAttributeValue
public String getAttributeValue(String attribute)
-
getAttributes
public Map<String,String> getAttributes()
-
getFirstElement
public StandardExtensionElement getFirstElement(String element, String namespace)
-
getFirstElement
public StandardExtensionElement getFirstElement(String element)
-
getElements
public List<StandardExtensionElement> getElements(String element, String namespace)
-
getElements
public List<StandardExtensionElement> getElements(String element)
-
getElements
public List<StandardExtensionElement> getElements()
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
builder
public static StandardExtensionElement.Builder builder(String name, String namespace)
-
-