Search in sources :

Example 1 with MessageData

use of net.sf.sdedit.diagram.MessageData in project abstools by abstools.

the class TextHandler method nextMessage.

/**
 * Returns the {@linkplain MessageData} object made from the current line.
 *
 * @return the {@linkplain MessageData} object made from the current line
 * @throws SyntaxError
 *             if the next message cannot be parsed
 */
public MessageData nextMessage() throws SyntaxError {
    if (section == 0) {
        throw new IllegalStateException("not all objects have been read");
    }
    if (currentLine == null) {
        throw new IllegalStateException("nothing to read");
    }
    MessageData data;
    try {
        data = new TextBasedMessageData(currentLine);
    } catch (SyntaxError e) {
        e.setProvider(this);
        throw e;
    }
    currentLine = null;
    return data;
}
Also used : SyntaxError(net.sf.sdedit.error.SyntaxError) MessageData(net.sf.sdedit.diagram.MessageData)

Aggregations

MessageData (net.sf.sdedit.diagram.MessageData)1 SyntaxError (net.sf.sdedit.error.SyntaxError)1