Class SpoilerElement
java.lang.Object
org.jivesoftware.smackx.spoiler.element.SpoilerElement
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.ExtensionElement,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlElement,org.jivesoftware.smack.packet.XmlLangElement
public class SpoilerElement
extends Object
implements org.jivesoftware.smack.packet.ExtensionElement
-
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(org.jivesoftware.smack.packet.Message message) Add a SpoilerElement to a message.static voidaddSpoiler(org.jivesoftware.smack.packet.Message message, String hint) Add a SpoilerElement with a hint to a message.static voidaddSpoiler(org.jivesoftware.smack.packet.Message message, String lang, String hint) Add a SpoilerElement with a hint in a certain language to a message.static booleancontainsSpoiler(org.jivesoftware.smack.packet.Message message) Returns true, if the message has at least one spoiler element.getHint()Return the hint text of the spoiler.getSpoilers(org.jivesoftware.smack.packet.Message message) Return a map of all spoilers contained in a message.toXML(org.jivesoftware.smack.packet.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.Element
toXML, toXMLMethods 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
public static void addSpoiler(org.jivesoftware.smack.packet.Message message) 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
public static void addSpoiler(org.jivesoftware.smack.packet.Message message, String lang, String hint) 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
public static boolean containsSpoiler(org.jivesoftware.smack.packet.Message message) 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
- Specified by:
getLanguagein interfaceorg.jivesoftware.smack.packet.XmlElement- Specified by:
getLanguagein interfaceorg.jivesoftware.smack.packet.XmlLangElement
-
getNamespace
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.XmlElement
-
getElementName
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
toXML
- Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-