Package org.biojava.utils
Class ParserException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.biojava.utils.ParserException
- All Implemented Interfaces:
Serializable
Exception thrown when an error occurs in document parsing.
It may optionally include the following fields:
Locator (file name, URL, etc.) Line number (negative for unknown) The text of the actual offending line (Null if unknown) Character offset (negative for unknown)
- Author:
- Matthew Pocock, Greg Cox
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParserException
(String detail) ParserException
(String detail, String locator) ParserException
(String detail, String locator, int line) ParserException
(String detail, String locator, int lineNumber, String line) ParserException
(String detail, String locator, int lineNumber, String line, int character) ParserException
(String message, Throwable cause) ParserException
(Throwable t, String detail) Deprecated.use new ParserException(detail, t)ParserException
(Throwable t, String detail, String locator) ParserException
(Throwable t, String detail, String locator, int line) ParserException
(Throwable t, String detail, String locator, int lineNumber, String line) ParserException
(Throwable t, String detail, String locator, int lineNumber, String line, int character) -
Method Summary
Modifier and TypeMethodDescriptionint
Get the character offset in the line where an error was detected.getLine()
Get the text of the line where the exception occured.int
Get the line number in the stream where this exception occured.Get a locator for the stream which caused this exception.toString()
Represent this exception as a string.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ParserException
-
ParserException
-
ParserException
-
ParserException
-
ParserException
-
ParserException
-
ParserException
Deprecated.use new ParserException(detail, t) -
ParserException
-
ParserException
-
ParserException
-
ParserException
-
ParserException
public ParserException(Throwable t, String detail, String locator, int lineNumber, String line, int character)
-
-
Method Details
-
getLocator
Get a locator for the stream which caused this exception.- Returns:
- A locator string, or
null
if none is known.
-
getLineNumber
Get the line number in the stream where this exception occured.- Returns:
- A positive integer line number, or -1 if not known.
-
getCharacterOffset
Get the character offset in the line where an error was detected.- Returns:
- The first character in the line where the parser detected an error, or -1 if the exception effects the whole line.
-
getLine
Get the text of the line where the exception occured.- Returns:
- The text of the line, or
null
if not known.
-
toString
Represent this exception as a string. This includes the default exception toString representation, followed by details of the location where the error occured, if they were supplied when constructing this exception.
-