286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 1999-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/A * $Id: WrappedRuntimeException.java,v 1.1.4.1 2005/09/08 11:03:21 suresh_emailid Exp $
286N/A */
286N/Apackage com.sun.org.apache.xml.internal.serializer.utils;
286N/A
286N/A/**
286N/A * This class is for throwing important checked exceptions
286N/A * over non-checked methods. It should be used with care,
286N/A * and in limited circumstances.
286N/A *
286N/A * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
286N/A * It exists to cut the serializers dependancy on that package.
286N/A *
286N/A * This class is not a public API, it is only public because it is
286N/A * used by com.sun.org.apache.xml.internal.serializer.
286N/A * @xsl.usage internal
286N/A */
286N/Apublic final class WrappedRuntimeException extends RuntimeException
286N/A{
286N/A static final long serialVersionUID = 7140414456714658073L;
286N/A
286N/A /** Primary checked exception.
286N/A * @serial */
286N/A private Exception m_exception;
286N/A
286N/A /**
286N/A * Construct a WrappedRuntimeException from a
286N/A * checked exception.
286N/A *
286N/A * @param e Primary checked exception
286N/A */
286N/A public WrappedRuntimeException(Exception e)
286N/A {
286N/A
286N/A super(e.getMessage());
286N/A
286N/A m_exception = e;
286N/A }
286N/A
286N/A /**
286N/A * Constructor WrappedRuntimeException
286N/A *
286N/A *
286N/A * @param msg Exception information.
286N/A * @param e Primary checked exception
286N/A */
286N/A public WrappedRuntimeException(String msg, Exception e)
286N/A {
286N/A
286N/A super(msg);
286N/A
286N/A m_exception = e;
286N/A }
286N/A
286N/A /**
286N/A * Get the checked exception that this runtime exception wraps.
286N/A *
286N/A * @return The primary checked exception
286N/A */
286N/A public Exception getException()
286N/A {
286N/A return m_exception;
286N/A }
286N/A}