gnu.text
Class SourceError

java.lang.Object
  extended by gnu.text.SourceError

public class SourceError
extends java.lang.Object

Represents an error message from processing a "source" file.


Field Summary
 int column
          The column number of the error, with 1 being the left-most column.
 java.lang.String filename
           
 int line
          The (1-origin) location of the error.
 java.lang.String message
          The actual error message.
 SourceError next
          Used to chain to the "next" message.
 char severity
          The seriousness of the error - one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error).
 
Constructor Summary
SourceError(char severity, java.lang.String filename, int line, int column, java.lang.String message)
           
SourceError(LineBufferedReader port, char severity, java.lang.String message)
          Create a new SourceError using the current line/column from a LineBufferedReader.
 
Method Summary
 void print(java.io.PrintWriter out)
           
 void println(java.io.PrintStream out)
           
 void println(java.io.PrintWriter out)
           
 java.lang.String toString()
          Convert the error to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

next

public SourceError next
Used to chain to the "next" message.


severity

public char severity
The seriousness of the error - one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error).


filename

public java.lang.String filename

line

public int line
The (1-origin) location of the error.


column

public int column
The column number of the error, with 1 being the left-most column. The value 0 means unknown or not applicable (such as the entire line).


message

public java.lang.String message
The actual error message. This is post-localization and -formatting. It can contain multiple lines, separated by '\n'.

Constructor Detail

SourceError

public SourceError(char severity,
                   java.lang.String filename,
                   int line,
                   int column,
                   java.lang.String message)

SourceError

public SourceError(LineBufferedReader port,
                   char severity,
                   java.lang.String message)
Create a new SourceError using the current line/column from a LineBufferedReader.

Method Detail

toString

public java.lang.String toString()
Convert the error to a String. The String starts with filename, line and option column, followed by the message. Warning messages are indicated as such.

Overrides:
toString in class java.lang.Object

print

public void print(java.io.PrintWriter out)

println

public void println(java.io.PrintWriter out)

println

public void println(java.io.PrintStream out)