org.mmbase.util
Class ErrorStruct

java.lang.Object
  |
  +--org.mmbase.util.ErrorStruct

public class ErrorStruct
extends java.lang.Object

Class for storing error information useful in parsing. Information that can be stored inlcudes the error type, column and line number of the parsed text where the error occurred, and a message. used by the Config module when parsing XML files.


Constructor Summary
ErrorStruct(int line, int col, java.lang.String msg)
          Creates an error structure, with errortype "none".
ErrorStruct(java.lang.String errorType, int line, int col, java.lang.String msg)
          Creates an error structure.
 
Method Summary
 int getColumnNumber()
          Returns the column number in the parsed source (file or textbuffer) where the error occurred.
 java.lang.String getErrorType()
          Returns the error type.
 int getLineNumber()
          Returns the line number in the parsed source (file or textbuffer) where the error occurred.
 java.lang.String getMessage()
          Returns a more detailed error message.
 java.lang.String toString()
          prints the ErrorStruct
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorStruct

public ErrorStruct(int line,
                   int col,
                   java.lang.String msg)
Creates an error structure, with errortype "none".
Parameters:
line - the line number where the error occurred
col - the column number where the error occurred
msg - the error message

ErrorStruct

public ErrorStruct(java.lang.String errorType,
                   int line,
                   int col,
                   java.lang.String msg)
Creates an error structure.
Parameters:
errorType - the type of error,
line - the line number where the error occurred
col - the column number where the error occurred
msg - the error message
Method Detail

getErrorType

public java.lang.String getErrorType()
Returns the error type. Values that might be expected are "warning", "error" and "fatal".

getLineNumber

public int getLineNumber()
Returns the line number in the parsed source (file or textbuffer) where the error occurred.

getColumnNumber

public int getColumnNumber()
Returns the column number in the parsed source (file or textbuffer) where the error occurred.

getMessage

public java.lang.String getMessage()
Returns a more detailed error message.

toString

public java.lang.String toString()
prints the ErrorStruct
Overrides:
toString in class java.lang.Object


MMBase 2001