Class JivePropertiesExtension
java.lang.Object
org.jivesoftware.smackx.jiveproperties.packet.JivePropertiesExtension
- All Implemented Interfaces:
Element,ExtensionElement,NamedElement,XmlElement,XmlLangElement
Properties provide an easy mechanism for clients to share data. Each property has a
String name, and a value that is a Java primitive (int, long, float, double, boolean)
or any Serializable object (a Java object is Serializable when it implements the
Serializable interface).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteProperty(String name) Deletes a property.static JivePropertiesExtensionReturn a Jive properties extensions of the given message.Returns the root element name.Returns the root element XML namespace.Returns an unmodifiable map of all properties.getProperty(String name) Returns the stanza property with the specified name ornullif the property doesn't exist.Returns an unmodifiable collection of all the property names that are set.voidsetProperty(String name, Object value) Sets a property with an Object as the value.toXML(XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
NAMESPACE
Namespace used to store stanza properties.- See Also:
-
ELEMENT
- See Also:
-
QNAME
-
-
Constructor Details
-
JivePropertiesExtension
public JivePropertiesExtension() -
JivePropertiesExtension
-
-
Method Details
-
getProperty
Returns the stanza property with the specified name ornullif the property doesn't exist. Property values that were originally primitives will be returned as their object equivalent. For example, an int property will be returned as an Integer, a double as a Double, etc.- Parameters:
name- the name of the property.- Returns:
- the property, or
nullif the property doesn't exist.
-
setProperty
Sets a property with an Object as the value. The value must be Serializable or an IllegalArgumentException will be thrown.- Parameters:
name- the name of the property.value- the value of the property.
-
deleteProperty
Deletes a property.- Parameters:
name- the name of the property to delete.
-
getPropertyNames
Returns an unmodifiable collection of all the property names that are set.- Returns:
- all property names.
-
getProperties
Returns an unmodifiable map of all properties.- Returns:
- all properties.
-
getElementName
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceXmlElement- Returns:
- the namespace.
-
toXML
-
from
Return a Jive properties extensions of the given message.- Parameters:
message- the message to return the extension from.- Returns:
- a Jive properties extension or null.
- Since:
- 4.2
-