net.sf.smc
Class SmcMessage

java.lang.Object
  extended by net.sf.smc.SmcMessage

public final class SmcMessage
extends java.lang.Object

Stores a warning or error message, the line number is occurred on and the FSM's name. The parser and syntax check no longer output errors directly. Instead they store them in a list and the calling application decides how to present these messages.


Field Summary
static int ERROR
          An error-level message (1).
static int WARNING
          A warning-level message (0).
 
Constructor Summary
SmcMessage(java.lang.String name, int lineNumber, int level, java.lang.String text)
          Creates a message for the given FSM, line number, level and text.
 
Method Summary
 int getLevel()
          Returns the message level, either WARNING or ERROR.
 int getLineNumber()
          Returns the line number.
 java.lang.String getName()
          Returns the finite state machine's name.
 java.lang.String getText()
          Returns the message text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WARNING

public static final int WARNING
A warning-level message (0).

See Also:
Constant Field Values

ERROR

public static final int ERROR
An error-level message (1).

See Also:
Constant Field Values
Constructor Detail

SmcMessage

public SmcMessage(java.lang.String name,
                  int lineNumber,
                  int level,
                  java.lang.String text)
Creates a message for the given FSM, line number, level and text.

Parameters:
name - the finite state machine's name.
lineNumber - the error's line number.
level - the message level. Must be either WARNING or ERROR.
text - the message text.
Throws:
java.lang.NullPointerException - if either name or text is null.
java.lang.IllegalArgumentException - if:
  • name is an empty string.
  • lineNumber is < zero.
  • level is neither WARNING nor ERROR.
  • text is an empty string.
Method Detail

getName

public java.lang.String getName()
Returns the finite state machine's name.

Returns:
the finite state machine's name.

getLineNumber

public int getLineNumber()
Returns the line number.

Returns:
the line number.

getLevel

public int getLevel()
Returns the message level, either WARNING or ERROR.

Returns:
the message level.

getText

public java.lang.String getText()
Returns the message text.

Returns:
the message text.