org.apache.batik.parser

Class ParseException

public class ParseException extends RuntimeException

This class encapsulates a general parse error or warning.

This class can contain basic error or warning information from either the parser or the application.

If the application needs to pass through other types of exceptions, it must wrap those exceptions in a ParseException.

Field Summary
protected intcolumnNumber
protected Exceptionexception
protected intlineNumber
Constructor Summary
ParseException(String message, int line, int column)
Creates a new ParseException.
ParseException(Exception e)
Creates a new ParseException wrapping an existing exception.
ParseException(String message, Exception e)
Creates a new ParseException from an existing exception.
Method Summary
intgetColumnNumber()
Returns the column of the last parsed character.
ExceptiongetException()
Return the embedded exception, if any.
intgetLineNumber()
Returns the line of the last parsed character.
StringgetMessage()
Return a detail message for this exception.

Field Detail

columnNumber

protected int columnNumber

Serial: The column number.

exception

protected Exception exception

Serial: The embedded exception if tunnelling, or null.

lineNumber

protected int lineNumber

Serial: The line number.

Constructor Detail

ParseException

public ParseException(String message, int line, int column)
Creates a new ParseException.

Parameters: message The error or warning message. line The line of the last parsed character. column The column of the last parsed character.

ParseException

public ParseException(Exception e)
Creates a new ParseException wrapping an existing exception.

The existing exception will be embedded in the new one, and its message will become the default message for the ParseException.

Parameters: e The exception to be wrapped in a ParseException.

ParseException

public ParseException(String message, Exception e)
Creates a new ParseException from an existing exception.

The existing exception will be embedded in the new one, but the new exception will have its own message.

Parameters: message The detail message. e The exception to be wrapped in a SAXException.

Method Detail

getColumnNumber

public int getColumnNumber()
Returns the column of the last parsed character.

getException

public Exception getException()
Return the embedded exception, if any.

Returns: The embedded exception, or null if there is none.

getLineNumber

public int getLineNumber()
Returns the line of the last parsed character.

getMessage

public String getMessage()
Return a detail message for this exception.

If there is a embedded exception, and if the ParseException has no detail message of its own, this method will return the detail message from the embedded exception.

Returns: The error or warning message.

Copyright B) 2007 Apache Software Foundation. All Rights Reserved.