public class Message extends Object implements CLogLevels, Serializable
LOG_CENTRAL, LOG_DEFAULT, LOG_INTERACTIVE, LOG_LOCAL, LOG_OPERATOR, LOG_SCREAM| Constructor and Description |
|---|
Message()
Default constructor for Message.
|
Message(String messageID)
Constructor with message id.
|
Message(String messageID,
MessageType messageType,
Object... args)
Constructor with message number and type.
|
Message(String messageID,
Object... args)
Constructor with message id and arguments.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDescription(String txt)
Adds another descriptive string.
|
void |
addMessage(Message that)
Adds information from another message into this.
|
void |
clearDescription()
Clears all texts.
|
void |
copy(Message that)
Copies information from another message into this message.
|
Object[] |
getArgs()
Returns the message arguments.
|
MessageContext |
getContext() |
String |
getDescription(int index)
Returns one of the description texts.
|
String |
getDescription(String delimiter)
Returns all the description texts.
|
Throwable |
getException()
Returns the stored exception (if any).
|
String |
getHint()
Returns the hint.
|
long |
getLogLevel()
Returns the log level as a LOG_xxx-constant.
|
String |
getMessageID()
Returns the message number.
|
List<Message> |
getMessages()
Gets the messages contained by this message.
|
String |
getMessageText()
Returns the main message text.
|
MessageType |
getMsgType()
Returns the message type as a MSGTYPE_xxx-constant.
|
String |
getReplString()
Returns the reply String.
|
MessageReplyType |
getReply()
Returns the selected reply as a REPLY_xxx-constant.
|
File |
getReplyFile()
Getter for the property replyFile.
|
String |
getRuntimeId()
Returns the runtime ID (message identifier).
|
Severity |
getSeverity()
Getter for the severity property.
|
String |
getTitle()
Returns the title.
|
ReplySetType |
getValidReplies()
Returns a REPLSET_xxx-constant for the valid replies to this message.
|
static boolean |
isEmpty(String s)
Convenience method, checks if the specified String is either empty (""),
or consists entirely of blanks (" "), or is a null-pointer, in which case
it returns
true |
void |
setArgs(Object[] pArgs)
Sets the message arguments.
|
void |
setContext(MessageContext context)
Set the new message context.
|
void |
setDescription(int index,
MessageText txt)
Sets new value of one of the texts.
|
void |
setDescription(int index,
String txt)
Sets new value of one of the texts - to a fixed String.
|
void |
setException(Throwable exc)
Stores an exception.
|
void |
setHint(String pHint)
Set new value of hint (tool tip, status bar etc).
|
void |
setLogLevel(long pLogLevel)
Sets new log level.
|
void |
setMessageID(String messageID)
Sets the message number.
|
void |
setMessageText(String pMessageText)
Set new main message text.
|
void |
setMsgType(MessageType pMsgType)
Sets the message type.
|
void |
setReplString(String newRepl)
Sets the new string reply.
|
void |
setReply(MessageReplyType pRepl)
Sets the actual reply.
|
void |
setReplyFile(File replyFile)
Sets the new value for replyFile.
|
void |
setSeverity(Severity severity)
Setter for the severity property.
|
void |
setTitle(String pTitle)
Set new value of title.
|
void |
setValidReplies(ReplySetType pReplies)
Sets valid replies for this message.
|
String |
toString()
Returns a String representation of this object.
|
public Message()
public Message(String messageID)
messageID - Message identificatorpublic Message(String messageID, Object... args)
messageID - Message identificatorargs - message argumentspublic Message(String messageID, MessageType messageType, Object... args)
messageID - Message idargs - message argumentsmessageType - Message type (MSGTYPE_xxx-constant)public String toString()
public String getRuntimeId()
public void setMessageID(String messageID)
messageID - New value of MessageID.getMessageID()public String getMessageID()
setMessageID(String)public void setArgs(Object[] pArgs)
pArgs - New value of args.getArgs()public Object[] getArgs()
setArgs(Object[])public void setValidReplies(ReplySetType pReplies)
pReplies - A REPLSET_xxx-constant for reply set.getValidReplies()public ReplySetType getValidReplies()
setValidReplies(ReplySetType)public void setReply(MessageReplyType pRepl)
pRepl - Selected reply as a REPLY_xxx-constant.getReply()public MessageReplyType getReply()
setReply(MessageReplyType)public void setMsgType(MessageType pMsgType)
pMsgType - Message type as a MSGTYPE_xxx-constant..getMsgType()public MessageType getMsgType()
setMsgType(MessageType)public void setLogLevel(long pLogLevel)
pLogLevel - New log level as a LOG_xxx-constant.getLogLevel()public long getLogLevel()
setLogLevel(long)public void setDescription(int index,
MessageText txt)
index - Index of the text to set. Must be >=0. If the index
creates a "hole" in the array, empty strings are added in
between.txt - The text to store.IndexOutOfBoundsException - If index is negativegetDescription(int),
setDescription(int, String)public void setDescription(int index,
String txt)
index - Index of the text to set. Must be >=0. If the index
creates a "hole" in the array, empty strings are added in
between.txt - The text to store.IndexOutOfBoundsException - If index is negativegetDescription(int),
setDescription(int, MessageText),
addDescription(String)public void addDescription(String txt)
txt - The text to add.getDescription(int),
setDescription(int, String)public void clearDescription()
setDescription(int, MessageText)public String getDescription(int index)
index - Index of the text to get. Must be >=0. Returns an empty
text if this index is not set.IndexOutOfBoundsException - If index is negativesetDescription(int, MessageText)public String getDescription(String delimiter)
delimiter - Inserted beween all elements. May be null.getDescription(int)public void addMessage(Message that)
that - Message to copy frompublic void copy(Message that)
that - Message to copy frompublic static boolean isEmpty(String s)
trues - the string to checktrue if the string is either empty or
nullpublic void setTitle(String pTitle)
pTitle - New value of title.getTitle()public String getTitle()
setTitle(String)public void setMessageText(String pMessageText)
pMessageText - New main text.getMessageText()public String getMessageText()
setMessageText(String)public void setHint(String pHint)
pHint - New value of hint.getHint()public String getHint()
setHint(String)public void setException(Throwable exc)
exc - Last exception thrown.getException()public Throwable getException()
setException(Throwable)public MessageContext getContext()
public void setContext(MessageContext context)
context - The new context.public void setReplString(String newRepl)
newRepl - New reply string.getReplString()public String getReplString()
setReplString(String)public File getReplyFile()
setReplyFile(File)public void setReplyFile(File replyFile)
replyFile - The new value for replyFile.getReplyFile()public void setSeverity(Severity severity)
severity - The severity to setpublic Severity getSeverity()
Copyright © 2006–2017 Esito AS. All rights reserved.