net.sf.sdedit.text
Class TextBasedMessageData

java.lang.Object
  extended by net.sf.sdedit.diagram.MessageData
      extended by net.sf.sdedit.text.TextBasedMessageData

public class TextBasedMessageData
extends MessageData

MessageData is data derived from strings representing messages exchanged between objects. These strings have the following format:

          {caller}[{level},{thread}]:>{answer}={callee}.{message}
 
{caller}, {callee} and {message} are strings and are mandatory. {answer}= is a string and is optional. [{level}] is optional, where {level} is an integer number.

When the parse method has finished, the parts of the string can be fetched via get methods. If no level is given, level is 0. If no answer is specified, answer is the empty string.

Author:
Markus Strauch

Constructor Summary
TextBasedMessageData(String string)
          Creates a new MessageParser for parsing a string.
 
Method Summary
 void setCallee(String callee)
           
 void setDummy(String dummy)
           
 void setLevelString(String level)
           
 void setMessage(String message)
           
 void setNoteId(String noteId)
           
 void setSpawner(String spawner)
          Sets the spawning object.
 void setThreadString(String thread)
           
 
Methods inherited from class net.sf.sdedit.diagram.MessageData
getAnswer, getAnswerNoteNumber, getBroadcastType, getCallee, getCalleeMnemonic, getCallees, getCaller, getCallerMnemonic, getLevel, getMessage, getNoteNumber, getProperty, getThread, isDestroyMessage, isNewMessage, isSpawnMessage, returnsInstantly, setAnswer, setAnswerNoteNumber, setBroadcastType, setCalleeMnemonic, setCallees, setCaller, setCallerMnemonic, setLevel, setNoteNumber, setProperties, setProperty, setReturnsInstantly, setSpawnMessage, setThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextBasedMessageData

public TextBasedMessageData(String string)
                     throws SyntaxError
Creates a new MessageParser for parsing a string.

Parameters:
string - the string to be parsed
Throws:
SyntaxError - if the string is not a valid message
Method Detail

setMessage

public void setMessage(String message)
Overrides:
setMessage in class MessageData
Parameters:
message - the message to set

setCallee

public void setCallee(String callee)
Overrides:
setCallee in class MessageData
Parameters:
callee - the callee to set

setSpawner

public void setSpawner(String spawner)
Sets the spawning object.

Parameters:
spawner - the spawning object

setLevelString

public void setLevelString(String level)
Parameters:
level - the level to set

setThreadString

public void setThreadString(String thread)

setDummy

public void setDummy(String dummy)

setNoteId

public void setNoteId(String noteId)


Copyright © 2011. All Rights Reserved.