Overview | Package | Class | Tree | Deprecated | Index | Help
| SMC 6_0_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.smc.parser
Class SmcMessage

    java.lang.Object
      net.sf.smc.parser.SmcMessage

    public final class SmcMessage

extends java.lang.Object

Stores a warning or error message, the .sm file line number on which it occurred and the FSM's name. The parser and syntax checker do not output errors directly. Instead they store errors in a list and the calling application decides how to present the 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SMC 6_0_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009. Charles W. Rapp. All Rights Reserved. Use is subject to license terms.