|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
nu.xom.ParsingException
This is the generic superclass for all the checked exceptions thrown in XOM. The general principle followed is that anything that could plausibly be detected by testing such as using spaces in an element name is a runtime exception. Exceptions that depend on environmental conditions, such as might occur when parsing an external file, are checked exceptions, because these depend on variable input, and thus problems may not all be detected during testing.
Constructor Summary | |
ParsingException(java.lang.String message)
Creates a new ParsingException with a detail message. |
|
ParsingException(java.lang.String message,
int lineNumber,
int columnNumber)
Creates a new ParsingException with a detail message
and line and column numbers. |
|
ParsingException(java.lang.String message,
int lineNumber,
int columnNumber,
java.lang.Throwable ex)
Creates a new ParsingException with a detail
message, line and column numbers, and an underlying exception. |
|
ParsingException(java.lang.String message,
java.lang.Throwable ex)
Creates a new ParsingException with a detail message
and an underlying root cause. |
Method Summary | |
java.lang.Throwable |
getCause()
Returns the underlying exception that caused this exception. |
int |
getColumnNumber()
Returns the approximate column number of the construct that caused this exception. |
int |
getLineNumber()
Returns the approximate row number of the construct that caused this exception. |
java.lang.Throwable |
initCause(java.lang.Throwable cause)
Sets the root cause of this exception. |
java.lang.String |
toString()
Returns a string suitable for display to the developer summarizing what went wrong where. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ParsingException(java.lang.String message, java.lang.Throwable ex)
Creates a new ParsingException
with a detail message
and an underlying root cause.
message
- indicates the specific problemex
- the original cause of this exceptionpublic ParsingException(java.lang.String message, int lineNumber, int columnNumber)
Creates a new ParsingException
with a detail message
and line and column numbers.
message
- indicates the specific problemlineNumber
- the approximate line number
where the problem occurscolumnNumber
- the approximate column number
where the problem occurspublic ParsingException(java.lang.String message, int lineNumber, int columnNumber, java.lang.Throwable ex)
Creates a new ParsingException
with a detail
message, line and column numbers, and an underlying exception.
message
- indicates the specific problemlineNumber
- the approximate line number
where the problem occurscolumnNumber
- the approximate column number
where the problem occursex
- the original cause of this exceptionpublic ParsingException(java.lang.String message)
Creates a new ParsingException
with a detail message.
message
- indicates the specific problemMethod Detail |
public int getLineNumber()
Returns the approximate row number of the construct that caused this exception. If the row number is not known, -1 is returned.
public int getColumnNumber()
Returns the approximate column number of the construct that caused this exception. If the column number is not known, -1 is returned.
public java.lang.Throwable initCause(java.lang.Throwable cause)
Sets the root cause of this exception. This may
only be called once. Subsequent calls throw an
IllegalStateException
.
This method is unnecessary in Java 1.4 where it could easily be inherited from the superclass. However, including it here allows this method to be used in Java 1.3 and earlier.
cause
- the root cause of this exception
XMLException
java.lang.IllegalArgumentException
- if the cause is this exception
(An exception cannot be its own cause.)
java.lang.IllegalStateException
- if this method is called twicepublic java.lang.Throwable getCause()
Returns the underlying exception that caused this exception.
public java.lang.String toString()
Returns a string suitable for display to the developer summarizing what went wrong where.
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |