|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleafchat.core.api.Msg
public abstract class Msg
Generic object representing communication between plugins. All messages must extend this class.
In addition to the visible API below, user-defined message types may include
a public static MessageInfo
member called 'info'. This provides
information for the scripting system. For example, if a message type isn't
appropriate for use as a scripting event, override the MessageInfo to return
false to MessageInfo.allowScripting()
. Here's a code example.
public static MessageInfo info=new MessageInfo(ErrorIRCMsg.class,"Error", "The server sends this event when you quit or are otherwise disconnected.") { protected void listScriptingVariables(Variables v) { super.listScriptingVariables(v); v.add("message"); } };
Field Summary | |
---|---|
static int |
PRIORITY_AFTERNORMAL
Priority constant: Where message should be handled after normal handlers |
static int |
PRIORITY_BEFORENORMAL
Priority constant: Where message should be handled before normal handlers |
static int |
PRIORITY_EARLY
Priority constant: Use where message should be handled before most other handlers |
static int |
PRIORITY_FIRST
Priority constant: Use where message should be handled first |
static int |
PRIORITY_LAST
Priority constant: Use where message should be handled last |
static int |
PRIORITY_LATE
Priority constant: Use where message should be handled after most handlers, but not necessarily last |
static int |
PRIORITY_NORMAL
Priority constant: Use for default message handling or where order does not matter |
Constructor Summary | |
---|---|
Msg()
|
Method Summary | |
---|---|
boolean |
isHandled()
|
boolean |
isStopped()
|
void |
markHandled()
Call to mark handled; still processed, but marked as already shown to user |
void |
markStopped()
Call to stop further processing |
boolean |
sequenceBefore(Msg consider)
Checks whether this message ought to run before the message under consideration. |
void |
setSequence(Msg relative)
Indicates that this message should belong to the same sequence as some other message (i.e. this one is presumably being dispatched in response to that one). |
void |
setSequence(java.lang.String sequenceName,
int sequenceNumber)
Associate this message with a particular sequence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PRIORITY_LAST
public static final int PRIORITY_LATE
public static final int PRIORITY_AFTERNORMAL
public static final int PRIORITY_NORMAL
public static final int PRIORITY_BEFORENORMAL
public static final int PRIORITY_EARLY
public static final int PRIORITY_FIRST
Constructor Detail |
---|
public Msg()
Method Detail |
---|
public boolean isStopped()
public void markStopped()
public boolean isHandled()
public void markHandled()
public void setSequence(java.lang.String sequenceName, int sequenceNumber)
sequenceName
- Arbitrary sequence namesequenceNumber
- Position in sequencepublic void setSequence(Msg relative)
relative
- Message whose sequence details will be copied.public boolean sequenceBefore(Msg consider)
consider
- Message being considered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |