blob: dc139a4e0d50b57b57f2a0e9e1dc9d18b170df66 [file] [log] [blame]
/*
* $Id$
*
* Copyright (c) 1998-1999 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*/
package javax.xml.transform;
/**
* Thrown when a problem with configuration with the Transformer Factories
* exists. This error will typically be thrown when the class of a
* transformation factory specified in the system properties cannot be found
* or instantiated.
*/
public class TFactoryConfigurationError extends Error {
private Exception exception;
/**
* Create a new <code>TFactoryConfigurationError</code> with no
* detail mesage.
*/
public TFactoryConfigurationError() {
super();
this.exception = null;
}
/**
* Create a new <code>TFactoryConfigurationError</code> with
* the <code>String </code> specified as an error message.
*
* @param msg The error message for the exception.
*/
public TFactoryConfigurationError(String msg) {
super(msg);
this.exception = null;
}
/**
* Create a new <code>TFactoryConfigurationError</code> with a
* given <code>Exception</code> base cause of the error.
*
* @param e The exception to be encapsulated in a
* TFactoryConfigurationError.
*/
public TFactoryConfigurationError(Exception e) {
super();
this.exception = e;
}
/**
* Create a new <code>TFactoryConfigurationError</code> with the
* given <code>Exception</code> base cause and detail message.
*
* @param e The exception to be encapsulated in a
* TFactoryConfigurationError
* @param msg The detail message.
* @param e The exception to be wrapped in a TFactoryConfigurationError
*/
public TFactoryConfigurationError(Exception e, String msg) {
super(msg);
this.exception = e;
}
/**
* Return the message (if any) for this error . If there is no
* message for the exception and there is an encapsulated
* exception then the message of that exception will be returned.
*
* @return The error message.
*/
public String getMessage () {
String message = super.getMessage ();
if (message == null && exception != null) {
return exception.getMessage();
}
return message;
}
/**
* Return the actual exception (if any) that caused this exception to
* be raised.
*
* @return The encapsulated exception, or null if there is none.
*/
public Exception getException () {
return exception;
}
}