APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xpath.internal

public Class XPathException

extends TransformerException
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xpath.internal.XPathProcessorException
Imports
javax.xml.transform.TransformerException, org.w3c.dom.Node

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.

Field Summary

Modifier and TypeField and Description
protected Exception
m_exception

A nested exception.

pack-priv Object
m_styleNode

The home of the expression that caused the error.

pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
XPathException(String
The error message.
message
,
ExpressionNode ex)

Create an XPathException object that holds an error message.

public
XPathException(String
The error message.
message
)

Create an XPathException object that holds an error message.

public
XPathException(String
The error message.
message
,
Object
The stylesheet node that the error originated from.
styleNode
)

Create an XPathException object that holds an error message and the stylesheet node that the error originated from.

public
XPathException(String
The error message.
message
,
Node
The stylesheet node that the error originated from.
styleNode
,
Exception
The exception that caused this 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.

public
XPathException(String
The error message.
message
,
Exception
The exception that caused this exception.
e
)

Create an XPathException object that holds an error message, and another exception that caused this exception.

Method Summary

Modifier and TypeMethod and Description
public Throwable

Returns:

The embedded exception, or null if there is none.
getException
()

Overrides javax.xml.transform.TransformerException.getException.

Return the embedded exception, if any.

protected ExpressionNode

Returns:

null or first ancestor that is not an Expression.
getExpressionOwner
(ExpressionNode ex)

Get the first non-Expression parent of this node.

public String

Returns:

The error message of the originating exception.
getMessage
()

Overrides java.lang.Throwable.getMessage.

Find the most contained message.

public Object

Returns:

The stylesheet node from where this error originated, or null.
getStylesheetNode
()

Get the stylesheet node from where this error originated.

public Node

Returns:

The dereference to the ElemVariable, or null if not found.
getStylesheetNode
(ExpressionNode ex)

Get the XSLT ElemVariable that this sub-expression references.

public void
printStackTrace(PrintStream
The stream where the dump will be sent to.
s
)

Overrides javax.xml.transform.TransformerException.printStackTrace.

Print the the trace of methods from where the error originated.

public void
printStackTrace(PrintWriter
The writer where the dump will be sent to.
s
)

Overrides javax.xml.transform.TransformerException.printStackTrace.

Print the the trace of methods from where the error originated.

public void
setStylesheetNode(Object
The stylesheet node from where this error originated, or null.
styleNode
)

Set the stylesheet node from where this error originated.

Inherited from javax.xml.transform.TransformerException:
getCausegetLocationAsStringgetLocatorgetMessageAndLocationinitCauseprintStackTracesetLocator

Field Detail

m_exceptionback to summary
protected Exception m_exception

A nested exception.

m_styleNodeback to summary
pack-priv Object m_styleNode

The home of the expression that caused the error.

Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.xml.transform.TransformerException.serialVersionUID.

Constructor Detail

XPathExceptionback to summary
public XPathException(String message, ExpressionNode ex)

Create an XPathException object that holds an error message.

Parameters
message:String

The error message.

XPathExceptionback to summary
public XPathException(String message)

Create an XPathException object that holds an error message.

Parameters
message:String

The error message.

XPathExceptionback to summary
public XPathException(String message, Object styleNode)

Create an XPathException object that holds an error message and the stylesheet node that the error originated from.

Parameters
message:String

The error message.

styleNode:Object

The stylesheet node that the error originated from.

XPathExceptionback to summary
public 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.

Parameters
message:String

The error message.

styleNode:Node

The stylesheet node that the error originated from.

e:Exception

The exception that caused this exception.

XPathExceptionback to summary
public XPathException(String message, Exception e)

Create an XPathException object that holds an error message, and another exception that caused this exception.

Parameters
message:String

The error message.

e:Exception

The exception that caused this exception.

Method Detail

getExceptionback to summary
public Throwable getException()

Overrides javax.xml.transform.TransformerException.getException.

Return the embedded exception, if any. Overrides javax.xml.transform.TransformerException.getException().

Returns:Throwable

The embedded exception, or null if there is none.

getExpressionOwnerback to summary
protected ExpressionNode getExpressionOwner(ExpressionNode ex)

Get the first non-Expression parent of this node.

Returns:ExpressionNode

null or first ancestor that is not an Expression.

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Find the most contained message.

Returns:String

The error message of the originating exception.

getStylesheetNodeback to summary
public Object getStylesheetNode()

Get the stylesheet node from where this error originated.

Returns:Object

The stylesheet node from where this error originated, or null.

getStylesheetNodeback to summary
public Node getStylesheetNode(ExpressionNode ex)

Get the XSLT ElemVariable that this sub-expression references. In order for this to work, the SourceLocator must be the owning ElemTemplateElement.

Returns:Node

The dereference to the ElemVariable, or null if not found.

printStackTraceback to summary
public void printStackTrace(PrintStream s)

Overrides javax.xml.transform.TransformerException.printStackTrace.

Print the the trace of methods from where the error originated. This will trace all nested exception objects, as well as this object.

Parameters
s:PrintStream

The stream where the dump will be sent to.

printStackTraceback to summary
public void printStackTrace(PrintWriter s)

Overrides javax.xml.transform.TransformerException.printStackTrace.

Print the the trace of methods from where the error originated. This will trace all nested exception objects, as well as this object.

Parameters
s:PrintWriter

The writer where the dump will be sent to.

setStylesheetNodeback to summary
public void setStylesheetNode(Object styleNode)

Set the stylesheet node from where this error originated.

Parameters
styleNode:Object

The stylesheet node from where this error originated, or null.