Class JDOMParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jdom2.JDOMException
org.jdom2.input.JDOMParseException
- All Implemented Interfaces:
Serializable
Thrown during parse errors, with information about where the parse error
occurred as well as access to the partially built document.
- Author:
- Laurent Bihanic
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJDOMParseException(String message, Throwable cause) This will create a parseExceptionwith the given message and wrap theExceptionthat cause a document parse to fail.JDOMParseException(String message, Throwable cause, Document partialDocument) This will create a parseExceptionwith the given message and the partial document and wrap theExceptionthat cause a document parse to fail. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the column number of the end of the text where the parse error occurred.intReturns the line number of the end of the text where the parse error occurred.Returns the partial document that was successfully built before the error occurred.Returns the public identifier of the entity where the parse error occurred.Returns the system identifier of the entity where the parse error occurred.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
JDOMParseException
This will create a parseExceptionwith the given message and wrap theExceptionthat cause a document parse to fail.- Parameters:
message-Stringmessage indicating the problem that occurred.cause-Throwablethat caused this to be thrown.
-
JDOMParseException
This will create a parseExceptionwith the given message and the partial document and wrap theExceptionthat cause a document parse to fail.- Parameters:
message-Stringmessage indicating the problem that occurred.cause-Throwablethat caused this to be thrown.partialDocument-Documentthe portion of the input XML document that was successfully built.
-
-
Method Details
-
getPartialDocument
Returns the partial document that was successfully built before the error occurred.- Returns:
- the partial document or null if none.
-
getPublicId
Returns the public identifier of the entity where the parse error occurred.- Returns:
- a string containing the public identifier, or
nullif the information is not available.
-
getSystemId
Returns the system identifier of the entity where the parse error occurred.- Returns:
- a string containing the system identifier, or
nullif the information is not available.
-
getLineNumber
public int getLineNumber()Returns the line number of the end of the text where the parse error occurred.The first line in the document is line 1.
- Returns:
- an integer representing the line number, or -1 if the information is not available.
-
getColumnNumber
public int getColumnNumber()Returns the column number of the end of the text where the parse error occurred.The first column in a line is position 1.
- Returns:
- an integer representing the column number, or -1 if the information is not available.
-