Top Description Fields Constructors Methods
javax.xml.transform

public Class TransformerException

extends Exception
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xpath.internal.XPathException, javax.xml.transform.TransformerConfigurationException
Imports
java.lang.reflect.Method, .InvocationTargetException, java.security.AccessControlContext, .AccessController, .CodeSigner, .CodeSource, .PermissionCollection, .Permissions, .PrivilegedAction, .ProtectionDomain, java.util.Objects

This class specifies an exceptional condition that occurred during the transformation process.
Since
1.4

Field Summary

Modifier and TypeField and Description
pack-priv Throwable
containedException

Field containedException specifies a wrapped exception.

pack-priv SourceLocator
locator

Field locator specifies where the error occurred

private static final long

Constructor Summary

AccessConstructor and Description
public
TransformerException(String
The error or warning message.
message
)

Create a new TransformerException.

public
TransformerException(Throwable
The exception to be wrapped.
e
)

Create a new TransformerException wrapping an existing exception.

public
TransformerException(String
The error or warning message, or null to use the message from the embedded exception.
message
,
Throwable
Any exception
e
)

Wrap an existing exception in a TransformerException.

public
TransformerException(String
The error or warning message.
message
,
SourceLocator
The locator object for the error or warning.
locator
)

Create a new TransformerException from a message and a Locator.

public
TransformerException(String
The error or warning message, or null to use the message from the embedded exception.
message
,
SourceLocator
The locator object for the error or warning.
locator
,
Throwable
Any exception
e
)

Wrap an existing exception in a TransformerException.

Method Summary

Modifier and TypeMethod and Description
public Throwable

Returns:

the cause, or null if unknown
getCause
()

Overrides java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown.
public Throwable

Returns:

An Throwable object, or null.
getException
()

This method retrieves an exception that this exception wraps.

public String

Returns:

A string with location info, or null if there is no location information.
getLocationAsString
()

Get the location information as a string.

private String

Returns:

the location string
getLocationString
()

Constructs the location string.

public SourceLocator

Returns:

A SourceLocator object, or null if none was specified.
getLocator
()

Method getLocator retrieves an instance of a SourceLocator object that specifies where an error occurred.

public String

Returns:

A String representing the error message with location information appended.
getMessageAndLocation
()

Get the error message with location information appended.

private ProtectionDomain

Returns:

a ProtectionDomain
getNonPrivDomain
()

Creates a ProtectionDomain that has no permission.

public synchronized Throwable

Returns:

a reference to this Throwable instance.
initCause
(Throwable
the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Overrides java.lang.Throwable.initCause.

Initializes the cause of this throwable to the specified value.
public void
printStackTrace()

Overrides java.lang.Throwable.printStackTrace.

Print the trace of methods from where the error originated.
public void
printStackTrace(PrintStream
The stream where the dump will be sent to.
s
)

Overrides java.lang.Throwable.printStackTrace.

Print the trace of methods from where the error originated.
public void
printStackTrace(PrintWriter
The writer where the dump will be sent to.
s
)

Overrides java.lang.Throwable.printStackTrace.

Print the trace of methods from where the error originated.
public void
setLocator(SourceLocator
A SourceLocator object, or null to clear the location.
location
)

Method setLocator sets an instance of a SourceLocator object that specifies where an error occurred.

Field Detail

containedExceptionback to summary
pack-priv Throwable containedException

Field containedException specifies a wrapped exception. May be null.

locatorback to summary
pack-priv SourceLocator locator

Field locator specifies where the error occurred

Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Constructor Detail

TransformerExceptionback to summary
public TransformerException(String message)

Create a new TransformerException.

Parameters
message:String

The error or warning message.

TransformerExceptionback to summary
public TransformerException(Throwable e)

Create a new TransformerException wrapping an existing exception.

Parameters
e:Throwable

The exception to be wrapped.

TransformerExceptionback to summary
public TransformerException(String message, Throwable e)

Wrap an existing exception in a TransformerException.

This is used for throwing processor exceptions before the processing has started.

Parameters
message:String

The error or warning message, or null to use the message from the embedded exception.

e:Throwable

Any exception

TransformerExceptionback to summary
public TransformerException(String message, SourceLocator locator)

Create a new TransformerException from a message and a Locator.

This constructor is especially useful when an application is creating its own exception from within a DocumentHandler callback.

Parameters
message:String

The error or warning message.

locator:SourceLocator

The locator object for the error or warning.

TransformerExceptionback to summary
public TransformerException(String message, SourceLocator locator, Throwable e)

Wrap an existing exception in a TransformerException.

Parameters
message:String

The error or warning message, or null to use the message from the embedded exception.

locator:SourceLocator

The locator object for the error or warning.

e:Throwable

Any exception

Method Detail

getCauseback to summary
public Throwable getCause()

Overrides java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

Returns:Throwable

the cause, or null if unknown

Annotations
@Override
getExceptionback to summary
public Throwable getException()

This method retrieves an exception that this exception wraps.

Returns:Throwable

An Throwable object, or null.

See Also
getCause
getLocationAsStringback to summary
public String getLocationAsString()

Get the location information as a string.

Returns:String

A string with location info, or null if there is no location information.

Annotations
@SuppressWarnings:removal
getLocationStringback to summary
private String getLocationString()

Constructs the location string.

Returns:String

the location string

getLocatorback to summary
public SourceLocator getLocator()

Method getLocator retrieves an instance of a SourceLocator object that specifies where an error occurred.

Returns:SourceLocator

A SourceLocator object, or null if none was specified.

getMessageAndLocationback to summary
public String getMessageAndLocation()

Get the error message with location information appended.

Returns:String

A String representing the error message with location information appended.

getNonPrivDomainback to summary
private ProtectionDomain getNonPrivDomain()

Creates a ProtectionDomain that has no permission.

Returns:ProtectionDomain

a ProtectionDomain

initCauseback to summary
public synchronized Throwable initCause(Throwable cause)

Overrides java.lang.Throwable.initCause.

Initializes the cause of this throwable to the specified value. (The cause is the throwable that caused this throwable to get thrown.)

This method can be called at most once. It is generally called from within the constructor, or immediately after creating the throwable. If this throwable was created with TransformerException(Throwable) or TransformerException(String, Throwable), this method cannot be called even once.

Parameters
cause:Throwable

the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Returns:Throwable

a reference to this Throwable instance.

Annotations
@Override
Exceptions
IllegalArgumentException:
if cause is this throwable. (A throwable cannot be its own cause.)
IllegalStateException:
if this throwable was created with TransformerException(Throwable) or TransformerException(String, Throwable), or this method has already been called on this throwable.
printStackTraceback to summary
public void printStackTrace()

Overrides java.lang.Throwable.printStackTrace.

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

Annotations
@Override
printStackTraceback to summary
public void printStackTrace(PrintStream s)

Overrides java.lang.Throwable.printStackTrace.

Print 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.

Annotations
@Override
printStackTraceback to summary
public void printStackTrace(PrintWriter s)

Overrides java.lang.Throwable.printStackTrace.

Print 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.

Annotations
@Override
setLocatorback to summary
public void setLocator(SourceLocator location)

Method setLocator sets an instance of a SourceLocator object that specifies where an error occurred.

Parameters
location:SourceLocator

A SourceLocator object, or null to clear the location.