286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2001, 2002,2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.xni;
286N/A
286N/A/**
286N/A * This exception is the base exception of all XNI exceptions. It
286N/A * can be constructed with an error message or used to wrap another
286N/A * exception object.
286N/A * <p>
286N/A * <strong>Note:</strong> By extending the Java
286N/A * <code>RuntimeException</code>, XNI handlers and components are
286N/A * not required to catch XNI exceptions but may explicitly catch
286N/A * them, if so desired.
286N/A *
286N/A * @author Andy Clark, IBM
286N/A *
286N/A * @version $Id: XNIException.java,v 1.6 2010-11-01 04:40:19 joehw Exp $
286N/A */
286N/Apublic class XNIException
286N/A extends RuntimeException {
286N/A
286N/A /** Serialization version. */
286N/A static final long serialVersionUID = 9019819772686063775L;
286N/A
286N/A //
286N/A // Data
286N/A //
286N/A
286N/A /** The wrapped exception. */
286N/A private Exception fException;
286N/A
286N/A //
286N/A // Constructors
286N/A //
286N/A
286N/A /**
286N/A * Constructs an XNI exception with a message.
286N/A *
286N/A * @param message The exception message.
286N/A */
286N/A public XNIException(String message) {
286N/A super(message);
286N/A } // <init>(String)
286N/A
286N/A /**
286N/A * Constructs an XNI exception with a wrapped exception.
286N/A *
286N/A * @param exception The wrapped exception.
286N/A */
286N/A public XNIException(Exception exception) {
286N/A super(exception.getMessage());
286N/A fException = exception;
286N/A } // <init>(Exception)
286N/A
286N/A /**
286N/A * Constructs an XNI exception with a message and wrapped exception.
286N/A *
286N/A * @param message The exception message.
286N/A * @param exception The wrapped exception.
286N/A */
286N/A public XNIException(String message, Exception exception) {
286N/A super(message);
286N/A fException = exception;
286N/A } // <init>(Exception,String)
286N/A
286N/A //
286N/A // Public methods
286N/A //
286N/A
286N/A /** Returns the wrapped exception. */
286N/A public Exception getException() {
286N/A return fException;
286N/A } // getException():Exception
286N/A
286N/A public Throwable getCause() {
286N/A return fException;
286N/A }
286N/A} // class QName