net.percederberg.grammatica.parser
Class ParserLogException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--net.percederberg.grammatica.parser.ParserLogException
All Implemented Interfaces:
java.io.Serializable

public class ParserLogException
extends java.lang.Exception

A parser log exception. This class contains a list of all the parse errors encountered while parsing.

Since:
1.1
See Also:
Serialized Form

Constructor Summary
ParserLogException()
          Creates a new empty parser log exception.
 
Method Summary
 void addError(ParseException e)
          Adds a parse error to the log.
 ParseException getError(int index)
          Returns a specific error from the log.
 int getErrorCount()
          Returns the number of errors in this log.
 java.lang.String getMessage()
          Returns the detailed error message.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParserLogException

public ParserLogException()
Creates a new empty parser log exception.

Method Detail

getErrorCount

public int getErrorCount()
Returns the number of errors in this log.

Returns:
the number of errors in this log

getError

public ParseException getError(int index)
Returns a specific error from the log.

Parameters:
index - the error index, 0 <= index < count
Returns:
the parse error requested

addError

public void addError(ParseException e)
Adds a parse error to the log.

Parameters:
e - the parse error to add

getMessage

public java.lang.String getMessage()
Returns the detailed error message. This message will contain the error messages from all errors in this log, separated by a newline.

Overrides:
getMessage in class java.lang.Throwable
Returns:
the detailed error message