Package org.apache.xpath
Class XPathException
java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.xml.transform.TransformerException
org.apache.xpath.XPathException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
XPathProcessorException
public class XPathException extends TransformerException
This class implements an exception object that all
XPath classes will throw in case of an error. This class
extends TransformerException, and may hold other exceptions. In the
case of nested exceptions, printStackTrace will dump
all the traces of the nested exceptions, not just the trace
of this object.
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected Exceptionm_exceptionA nested exception. -
Constructor Summary
Constructors Constructor Description XPathException(String message)Create an XPathException object that holds an error message.XPathException(String message, Exception e)Create an XPathException object that holds an error message, and another exception that caused this exception.XPathException(String message, Object styleNode)Create an XPathException object that holds an error message and the stylesheet node that the error originated from.XPathException(String message, ExpressionNode ex)Create an XPathException object that holds an error message.XPathException(String message, Node styleNode, Exception e)Create an XPathException object that holds an error message, the stylesheet node that the error originated from, and another exception that caused this exception. -
Method Summary
Modifier and Type Method Description ThrowablegetException()Return the embedded exception, if any.protected ExpressionNodegetExpressionOwner(ExpressionNode ex)Get the first non-Expression parent of this node.StringgetMessage()Find the most contained message.ObjectgetStylesheetNode()Get the stylesheet node from where this error originated.NodegetStylesheetNode(ExpressionNode ex)Get the XSLT ElemVariable that this sub-expression references.voidprintStackTrace(PrintStream s)Print the the trace of methods from where the error originated.voidprintStackTrace(PrintWriter s)Print the the trace of methods from where the error originated.voidsetStylesheetNode(Object styleNode)Set the stylesheet node from where this error originated.Methods inherited from class javax.xml.transform.TransformerException
getCause, getLocationAsString, getLocator, getMessageAndLocation, initCause, printStackTrace, setLocatorMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, setStackTrace, toString
-
Field Details
-
m_exception
A nested exception.
-
-
Constructor Details
-
XPathException
Create an XPathException object that holds an error message.- Parameters:
message- The error message.
-
XPathException
Create an XPathException object that holds an error message.- Parameters:
message- The error message.
-
XPathException
Create an XPathException object that holds an error message and the stylesheet node that the error originated from.- Parameters:
message- The error message.styleNode- The stylesheet node that the error originated from.
-
XPathException
Create an XPathException object that holds an error message, the stylesheet node that the error originated from, and another exception that caused this exception.- Parameters:
message- The error message.styleNode- The stylesheet node that the error originated from.e- The exception that caused this exception.
-
XPathException
Create an XPathException object that holds an error message, and another exception that caused this exception.- Parameters:
message- The error message.e- The exception that caused this exception.
-
-
Method Details
-
getStylesheetNode
Get the stylesheet node from where this error originated.- Returns:
- The stylesheet node from where this error originated, or null.
-
setStylesheetNode
Set the stylesheet node from where this error originated.- Parameters:
styleNode- The stylesheet node from where this error originated, or null.
-
getStylesheetNode
Get the XSLT ElemVariable that this sub-expression references. In order for this to work, the SourceLocator must be the owning ElemTemplateElement.- Returns:
- The dereference to the ElemVariable, or null if not found.
-
getExpressionOwner
Get the first non-Expression parent of this node.- Returns:
- null or first ancestor that is not an Expression.
-
printStackTrace
Print the the trace of methods from where the error originated. This will trace all nested exception objects, as well as this object.- Overrides:
printStackTracein classTransformerException- Parameters:
s- The stream where the dump will be sent to.
-
getMessage
Find the most contained message.- Overrides:
getMessagein classThrowable- Returns:
- The error message of the originating exception.
-
printStackTrace
Print the the trace of methods from where the error originated. This will trace all nested exception objects, as well as this object.- Overrides:
printStackTracein classTransformerException- Parameters:
s- The writer where the dump will be sent to.
-
getException
Return the embedded exception, if any. Overrides javax.xml.transform.TransformerException.getException().- Overrides:
getExceptionin classTransformerException- Returns:
- The embedded exception, or null if there is none.
- See Also:
TransformerException.getCause()
-