Class XIncludeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- nu.xom.xinclude.XIncludeException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
BadEncodingAttributeException,BadHrefAttributeException,BadHTTPHeaderException,BadParseAttributeException,InclusionLoopException,MisplacedFallbackException,NoIncludeLocationException
public class XIncludeException extends java.lang.ExceptionThe generic superclass for all checked exceptions that may be thrown as a result of a violation of XInclude's rules.
- Version:
- 1.1b3
- Author:
- Elliotte Rusty Harold
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XIncludeException(java.lang.String message)Constructs anXIncludeExceptionwith the specified detail message.XIncludeException(java.lang.String message, java.lang.String uri)Creates a newXIncludeExceptionwith a detail message, line and column numbers, and the URI of the document that caused the exception.XIncludeException(java.lang.String message, java.lang.Throwable cause)Constructs anXIncludeExceptionwith the specified detail message and initial cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThrowablegetCause()When anIOException,MalformedURLException, or other generic exception is thrown while processing an XML document for XIncludes, it is customarily replaced by some form ofXIncludeException.java.lang.StringgetURI()Returns the URI of the document that caused this exception.java.lang.ThrowableinitCause(java.lang.Throwable cause)When anIOException,MalformedURLException, or other generic exception is thrown while processing an XML document for XIncludes, it is customarily replaced by some form ofXIncludeException.
-
-
-
Constructor Detail
-
XIncludeException
public XIncludeException(java.lang.String message)
Constructs an
XIncludeExceptionwith the specified detail message.- Parameters:
message- a string indicating the specific problem
-
XIncludeException
public XIncludeException(java.lang.String message, java.lang.Throwable cause)Constructs an
XIncludeExceptionwith the specified detail message and initial cause. The error message stringmessagecan later be retrieved by themethod of classThrowable.getMessage()java.lang.Throwable.- Parameters:
message- a string indicating the specific problemcause- the initial cause of the exception
-
XIncludeException
public XIncludeException(java.lang.String message, java.lang.String uri)Creates a new
XIncludeExceptionwith a detail message, line and column numbers, and the URI of the document that caused the exception.- Parameters:
message- a string indicating the specific problemuri- the URI of the document that caused this exception
-
-
Method Detail
-
getURI
public java.lang.String getURI()
Returns the URI of the document that caused this exception. If the URI is not known, null is returned.
- Returns:
- URI of the document where the exception occurred
-
getCause
public java.lang.Throwable getCause()
When an
IOException,MalformedURLException, or other generic exception is thrown while processing an XML document for XIncludes, it is customarily replaced by some form ofXIncludeException. This method allows you to retrieve the original exception. It returns null if no such exception caused thisXIncludeException.- Overrides:
getCausein classjava.lang.Throwable- Returns:
- the underlying exception which caused this XIncludeException to be thrown
-
initCause
public java.lang.Throwable initCause(java.lang.Throwable cause)
When an
IOException,MalformedURLException, or other generic exception is thrown while processing an XML document for XIncludes, it is customarily replaced by some form ofXIncludeException. This method allows you to store the original exception.- Overrides:
initCausein classjava.lang.Throwable- Parameters:
cause- the root cause of this exception- Returns:
- this
XIncludeException - Throws:
java.lang.IllegalArgumentException- if the cause is this exception (An exception cannot be its own cause.)java.lang.IllegalStateException- if this method is called twice
-
-