|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mudcraft.bukkit.socials.message.Message
public class Message
The Message
class is used used to create and broadcast
output in accordance with a format that also varies depending upon
which player witnesses it.
The format specifier is a character string. The format specifier is composed of zero of more directives: ordinary characters (not {), which are copied, unchanged, to the output; and conversion specifications, each of which results in fetching zero or more arguments.
Each conversion specification is introduced by the { character, and
ends with the } character. In between, there may be one or two macros,
the second of which, if present, is delimited by a : character. The
first macro is expanded only when the message is witnessed by the
actor, the Player
performing the message; the second macro is
expanded when another Player
witnesses the message.
Macros may contain either one component, or two components separated by a . character. A single component is interpreted as a literal; it is trimmed of leading and trailing whitespace but no other evaluation is performed. Alternatively, if two components are found, the first identifies the context element to be evaluated and the second identifies which property of the context element to select.
The following properties are supported:
Nested Class Summary | |
---|---|
class |
Message.Context
Contains contextual information used to render a message. |
static interface |
Message.Filter
Defines the contract for specialized predicate classes that indicate whether a Player is eligible to receive a message. |
Constructor Summary | |
---|---|
Message(Socials plugin)
Constructs a new Message instance. |
Method Summary | |
---|---|
org.bukkit.ChatColor |
getChatColor()
Gets the message's chat color. |
Message.Context |
getContext()
Gets the message context. |
java.util.List<Message.Filter> |
getFilters()
Gets the configured filters. |
java.lang.String |
getFormatSpecifier()
Gets the message's format specifier. |
Socials |
getPlugin()
Gets the Socials plug-in. |
void |
send(org.bukkit.entity.Player me)
Sends the message. |
Message |
setChatColor(org.bukkit.ChatColor chatColor)
Sets the message's chat color. |
Message |
setFormatSpecifier(java.lang.String formatSpecifier)
Sets the message's format specifier. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Message(Socials plugin)
Message
instance.
plugin
- the Socials
objectMethod Detail |
---|
public org.bukkit.ChatColor getChatColor()
ChatColor
of the messagesetChatColor(ChatColor)
public java.util.List<Message.Filter> getFilters()
List
of Message.Filter
spublic java.lang.String getFormatSpecifier()
setFormatSpecifier(String)
public Message.Context getContext()
Message.Context
objectpublic Socials getPlugin()
Socials
objectpublic void send(org.bukkit.entity.Player me)
me
- the Player
doing the messagepublic Message setChatColor(org.bukkit.ChatColor chatColor)
chatColor
- the ChatColor
of the message
getChatColor()
public Message setFormatSpecifier(java.lang.String formatSpecifier)
formatSpecifier
- the message's format specifier
getFormatSpecifier()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |