286N/A/*
286N/A * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286N/A *
286N/A * This code is free software; you can redistribute it and/or modify it
286N/A * under the terms of the GNU General Public License version 2 only, as
286N/A * published by the Free Software Foundation. Oracle designates this
286N/A * particular file as subject to the "Classpath" exception as provided
286N/A * by Oracle in the LICENSE file that accompanied this code.
286N/A *
286N/A * This code is distributed in the hope that it will be useful, but WITHOUT
286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286N/A * version 2 for more details (a copy is included in the LICENSE file that
286N/A * accompanied this code).
286N/A *
286N/A * You should have received a copy of the GNU General Public License version
286N/A * 2 along with this work; if not, write to the Free Software Foundation,
286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286N/A *
286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
286N/A * or visit www.oracle.com if you need additional information or have any
286N/A * questions.
286N/A */
286N/A
286N/Apackage javax.xml.transform;
286N/A
286N/A/**
286N/A * Thrown when a problem with configuration with the Transformer Factories
286N/A * exists. This error will typically be thrown when the class of a
286N/A * transformation factory specified in the system properties cannot be found
286N/A * or instantiated.
286N/A */
286N/Apublic class TransformerFactoryConfigurationError extends Error {
286N/A private static final long serialVersionUID = -6527718720676281516L;
286N/A
286N/A /**
286N/A * <code>Exception</code> for the
286N/A * <code>TransformerFactoryConfigurationError</code>.
286N/A */
286N/A private Exception exception;
286N/A
286N/A /**
286N/A * Create a new <code>TransformerFactoryConfigurationError</code> with no
286N/A * detail mesage.
286N/A */
286N/A public TransformerFactoryConfigurationError() {
286N/A
286N/A super();
286N/A
286N/A this.exception = null;
286N/A }
286N/A
286N/A /**
286N/A * Create a new <code>TransformerFactoryConfigurationError</code> with
286N/A * the <code>String</code> specified as an error message.
286N/A *
286N/A * @param msg The error message for the exception.
286N/A */
286N/A public TransformerFactoryConfigurationError(String msg) {
286N/A
286N/A super(msg);
286N/A
286N/A this.exception = null;
286N/A }
286N/A
286N/A /**
286N/A * Create a new <code>TransformerFactoryConfigurationError</code> with a
286N/A * given <code>Exception</code> base cause of the error.
286N/A *
286N/A * @param e The exception to be encapsulated in a
286N/A * TransformerFactoryConfigurationError.
286N/A */
286N/A public TransformerFactoryConfigurationError(Exception e) {
286N/A
286N/A super(e.toString());
286N/A
286N/A this.exception = e;
286N/A }
286N/A
286N/A /**
286N/A * Create a new <code>TransformerFactoryConfigurationError</code> with the
286N/A * given <code>Exception</code> base cause and detail message.
286N/A *
286N/A * @param e The exception to be encapsulated in a
286N/A * TransformerFactoryConfigurationError
286N/A * @param msg The detail message.
286N/A */
286N/A public TransformerFactoryConfigurationError(Exception e, String msg) {
286N/A
286N/A super(msg);
286N/A
286N/A this.exception = e;
286N/A }
286N/A
286N/A /**
286N/A * Return the message (if any) for this error . If there is no
286N/A * message for the exception and there is an encapsulated
286N/A * exception then the message of that exception will be returned.
286N/A *
286N/A * @return The error message.
286N/A */
286N/A public String getMessage() {
286N/A
286N/A String message = super.getMessage();
286N/A
286N/A if ((message == null) && (exception != null)) {
286N/A return exception.getMessage();
286N/A }
286N/A
286N/A return message;
286N/A }
286N/A
286N/A /**
286N/A * Return the actual exception (if any) that caused this exception to
286N/A * be raised.
286N/A *
286N/A * @return The encapsulated exception, or null if there is none.
286N/A */
286N/A public Exception getException() {
286N/A return exception;
286N/A }
286N/A /**
286N/A * use the exception chaining mechanism of JDK1.4
286N/A */
286N/A @Override
286N/A public Throwable getCause() {
286N/A return exception;
286N/A }
286N/A}