Class SpoilerElement
java.lang.Object
org.jivesoftware.smackx.spoiler.element.SpoilerElement
- All Implemented Interfaces:
Element,ExtensionElement,NamedElement,XmlElement,XmlLangElement
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpoilerElement(String language, String hint) Create a new SpoilerElement with a hint about a content and a language attribute. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddSpoiler(Message message) Add a SpoilerElement to a message.static voidaddSpoiler(Message message, String hint) Add a SpoilerElement with a hint to a message.static voidaddSpoiler(Message message, String lang, String hint) Add a SpoilerElement with a hint in a certain language to a message.static booleancontainsSpoiler(Message message) Returns true, if the message has at least one spoiler element.Returns the root element name.getHint()Return the hint text of the spoiler.Returns the xml:lang of this XML element, or null if one has not been set.Returns the root element XML namespace.getSpoilers(Message message) Return a map of all spoilers contained in a message.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
getQName
-
Field Details
-
ELEMENT
- See Also:
-
NAMESPACE
- See Also:
-
QNAME
-
EMPTY
-
-
Constructor Details
-
SpoilerElement
Create a new SpoilerElement with a hint about a content and a language attribute.- Parameters:
language- language of the hint.hint- hint about the content.
-
-
Method Details
-
getHint
Return the hint text of the spoiler. May be null.- Returns:
- hint text
-
addSpoiler
Add a SpoilerElement to a message.- Parameters:
message- message to add the Spoiler to.
-
addSpoiler
Add a SpoilerElement with a hint to a message.- Parameters:
message- Message to add the Spoiler to.hint- Hint about the Spoilers content.
-
addSpoiler
Add a SpoilerElement with a hint in a certain language to a message.- Parameters:
message- Message to add the Spoiler to.lang- language of the Spoiler hint.hint- hint.
-
containsSpoiler
Returns true, if the message has at least one spoiler element.- Parameters:
message- message- Returns:
- true if message has spoiler extension
-
getSpoilers
Return a map of all spoilers contained in a message. The map uses the language of a spoiler as key. If a spoiler has no language attribute, its key will be an empty String.- Parameters:
message- message- Returns:
- map of spoilers
-
getLanguage
Description copied from interface:XmlLangElementReturns the xml:lang of this XML element, or null if one has not been set.- Specified by:
getLanguagein interfaceXmlElement- Specified by:
getLanguagein interfaceXmlLangElement- Returns:
- the xml:lang of this XML element, or null.
-
getNamespace
Description copied from interface:XmlElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceXmlElement- Returns:
- the namespace.
-
getElementName
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
toXML
-