notio
Class ParserException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--notio.OperationException
                    |
                    +--notio.TranslationException
                          |
                          +--notio.ParserException
All Implemented Interfaces:
java.io.Serializable

public class ParserException
extends TranslationException

Exception thrown when some parser's operation gives rise to an error.

See Also:
Serialized Form

Constructor Summary
ParserException(java.lang.String message)
          Constructs an exception with the specified message.
ParserException(java.lang.String message, java.lang.String newOffendingToken, int newBeginLine, int newEndLine, int newBeginColumn, int newEndColumn, java.lang.String[] newExpectedTokens, boolean newBeforeFlag, boolean newAfterFlag)
          Constructs an exception with the specified message and details of the token that triggered this exception.
ParserException(java.lang.String message, java.lang.Throwable newSubThrowable)
          Constructs an exception with the specified message and sub-throwable.
ParserException(java.lang.String message, java.lang.Throwable newSubThrowable, java.lang.String newOffendingToken, int newBeginLine, int newEndLine, int newBeginColumn, int newEndColumn, java.lang.String[] newExpectedTokens, boolean newBeforeFlag, boolean newAfterFlag)
          Constructs an exception with the specified message, sub-throwable, and details of the token that triggered this exception.
 
Method Summary
 int getBeginColumn()
          Returns the beginning column of the offending token related to this exception or 0 if none has been specified.
 int getBeginLine()
          Returns the beginning line of the offending token related to this exception or 0 if none has been specified.
 int getEndColumn()
          Returns the ending column of the offending token related to this exception or 0 if none has been specified.
 int getEndLine()
          Returns the ending line of the offending token related to this exception or 0 if none has been specified.
 java.lang.String[] getExpectedTokens()
          Returns an array containing tokens that would have been accept in place of the offending token related to this exceptionm, or null if none have been specified.
 java.lang.String getOccurranceMessage()
          Returns a string containing information about the token and/or location involved in this exception, or null if no details are available.
 java.lang.String getOffendingToken()
          Returns the offending token related to this exception or null if none has been specified.
 
Methods inherited from class notio.OperationException
getSubThrowable, setSubThrowable
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParserException

public ParserException(java.lang.String message)
Constructs an exception with the specified message.
Parameters:
message - The details of the exception.

ParserException

public ParserException(java.lang.String message,
                       java.lang.Throwable newSubThrowable)
Constructs an exception with the specified message and sub-throwable.
Parameters:
message - the details of the exception.
newSubThrowable - the sub-throwable to be embedded in this exception.

ParserException

public ParserException(java.lang.String message,
                       java.lang.Throwable newSubThrowable,
                       java.lang.String newOffendingToken,
                       int newBeginLine,
                       int newEndLine,
                       int newBeginColumn,
                       int newEndColumn,
                       java.lang.String[] newExpectedTokens,
                       boolean newBeforeFlag,
                       boolean newAfterFlag)
Constructs an exception with the specified message, sub-throwable, and details of the token that triggered this exception.
Parameters:
message - the details of the exception.
newSubThrowable - the sub-throwable to be embedded in this exception.
newOffendingToken - the offending token.
newBeginLine - the line on which the offending token begins.
newEndLine - the line on which the offending token ends.
newBeginColumn - the column at which the offending token begins.
newEndColumn - the column at which the offending token ends.
newExpectedTokens - an array containing tokens that were expected in place of the offending token.
newBeforeFlag - a flag indicating that the cause of the exception is actually somewhere before the specified token or location.
newAfterFlag - a flag indicating that the cause of the exception is actually somewhere after the specified token or location.

ParserException

public ParserException(java.lang.String message,
                       java.lang.String newOffendingToken,
                       int newBeginLine,
                       int newEndLine,
                       int newBeginColumn,
                       int newEndColumn,
                       java.lang.String[] newExpectedTokens,
                       boolean newBeforeFlag,
                       boolean newAfterFlag)
Constructs an exception with the specified message and details of the token that triggered this exception.
Parameters:
message - the details of the exception.
newOffendingToken - the offending token.
newBeginLine - the line on which the offending token begins.
newEndLine - the line on which the offending token ends.
newBeginColumn - the column at which the offending token begins.
newEndColumn - the column at which the offending token ends.
newExpectedTokens - an array containing tokens that were expected in place of the offending token.
newBeforeFlag - a flag indicating that the cause of the exception is actually somewhere before the specified token or location.
newAfterFlag - a flag indicating that the cause of the exception is actually somewhere after the specified token or location.
Method Detail

getOffendingToken

public java.lang.String getOffendingToken()
Returns the offending token related to this exception or null if none has been specified.
Returns:
the offending token or null.

getBeginLine

public int getBeginLine()
Returns the beginning line of the offending token related to this exception or 0 if none has been specified. Note that it is possible to have a beginning line but still have null returned by getOffendingToken(). Lines are numbered starting at 1.
Returns:
the beginning line of this exception or 0.

getEndLine

public int getEndLine()
Returns the ending line of the offending token related to this exception or 0 if none has been specified. Note that it is possible to have a ending line but still have null returned by getOffendingToken(). Lines are numbered starting at 1.
Returns:
the ending line of this exception or 0.

getBeginColumn

public int getBeginColumn()
Returns the beginning column of the offending token related to this exception or 0 if none has been specified. Note that it is possible to have a beginning column but still have null returned by getOffendingToken(). Columns are numbered starting at 1.
Returns:
the beginning column of this exception or 0.

getEndColumn

public int getEndColumn()
Returns the ending column of the offending token related to this exception or 0 if none has been specified. Note that it is possible to have a ending column but still have null returned by getOffendingToken(). Columns are numbered starting at 1.
Returns:
the ending column of this exception or 0.

getExpectedTokens

public java.lang.String[] getExpectedTokens()
Returns an array containing tokens that would have been accept in place of the offending token related to this exceptionm, or null if none have been specified.
Returns:
the array of expected tokens or null.

getOccurranceMessage

public java.lang.String getOccurranceMessage()
Returns a string containing information about the token and/or location involved in this exception, or null if no details are available. The standard getMessage() method in this exception should only return an explanation of the error. It will frequently be desirable to provide both messages, but on occasion only one will be desired or the formatting must be tightly controlled. The message will always be a single line. If more control is needed, the methods for accessing individual details about the exception should be used to construct a message. Parsing the results of this method is strongly discouraged since no guarantees are provided as to its format.
Returns:
a string containing the message, or null.


Copyright 1998-2001 Finnegan Southey