public class SpoilerElement extends java.lang.Object implements ExtensionElement
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT |
static SpoilerElement |
EMPTY |
static java.lang.String |
NAMESPACE |
Constructor and Description |
---|
SpoilerElement(java.lang.String language,
java.lang.String hint)
Create a new SpoilerElement with a hint about a content and a language attribute.
|
Modifier and Type | Method and Description |
---|---|
static void |
addSpoiler(Message message)
Add a SpoilerElement to a message.
|
static void |
addSpoiler(Message message,
java.lang.String hint)
Add a SpoilerElement with a hint to a message.
|
static void |
addSpoiler(Message message,
java.lang.String lang,
java.lang.String hint)
Add a SpoilerElement with a hint in a certain language to a message.
|
static boolean |
containsSpoiler(Message message)
Returns true, if the message has at least one spoiler element.
|
java.lang.String |
getElementName()
Returns the root element name.
|
java.lang.String |
getHint()
Return the hint text of the spoiler.
|
java.lang.String |
getLanguage()
Return the language of the hint.
|
java.lang.String |
getNamespace()
Returns the root element XML namespace.
|
static java.util.Map<java.lang.String,java.lang.String> |
getSpoilers(Message message)
Return a map of all spoilers contained in a message.
|
java.lang.CharSequence |
toXML()
Returns the XML representation of this Element.
|
public static final java.lang.String ELEMENT
public static final java.lang.String NAMESPACE
public static final SpoilerElement EMPTY
public SpoilerElement(java.lang.String language, java.lang.String hint)
language
- language of the hint.hint
- hint about the content.public java.lang.String getHint()
public static void addSpoiler(Message message)
message
- message to add the Spoiler to.public static void addSpoiler(Message message, java.lang.String hint)
message
- Message to add the Spoiler to.hint
- Hint about the Spoilers content.public static void addSpoiler(Message message, java.lang.String lang, java.lang.String hint)
message
- Message to add the Spoiler to.lang
- language of the Spoiler hint.hint
- hint.public static boolean containsSpoiler(Message message)
message
- messagepublic static java.util.Map<java.lang.String,java.lang.String> getSpoilers(Message message)
message
- messagepublic java.lang.String getLanguage()
public java.lang.String getNamespace()
ExtensionElement
getNamespace
in interface ExtensionElement
public java.lang.String getElementName()
NamedElement
getElementName
in interface NamedElement