| %line | %branch | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| tsukuba_bunko.peko.InitializationError |
|
|
| 1 | /* |
|
| 2 | * All Rights Reserved. |
|
| 3 | * Copyright (C) 1999-2005 Tsukuba Bunko. |
|
| 4 | * |
|
| 5 | * Licensed under the BSD License ("the License"); you may not use |
|
| 6 | * this file except in compliance with the License. |
|
| 7 | * You may obtain a copy of the License at |
|
| 8 | * |
|
| 9 | * http://www.tsukuba-bunko.org/licenses/LICENSE.txt |
|
| 10 | * |
|
| 11 | * Unless required by applicable law or agreed to in writing, software |
|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 14 | * See the License for the specific language governing permissions and |
|
| 15 | * limitations under the License. |
|
| 16 | * |
|
| 17 | * $Id: InitializationError.java,v 1.2 2005/07/23 18:51:21 ppoi Exp $ |
|
| 18 | */ |
|
| 19 | package tsukuba_bunko.peko; |
|
| 20 | ||
| 21 | import java.io.PrintStream; |
|
| 22 | import java.io.PrintWriter; |
|
| 23 | ||
| 24 | ||
| 25 | /** |
|
| 26 | * 初期化が失敗したことを通知する致命的例外です。 |
|
| 27 | * @author $Author: ppoi $ |
|
| 28 | * @version $Revision: 1.2 $ |
|
| 29 | */ |
|
| 30 | public class InitializationError extends Error { |
|
| 31 | ||
| 32 | /** |
|
| 33 | * serial version UID |
|
| 34 | */ |
|
| 35 | private static final long serialVersionUID = -2744308972387830412L; |
|
| 36 | ||
| 37 | /** |
|
| 38 | * 基になる例外オブジェクト |
|
| 39 | */ |
|
| 40 | 0 | private Throwable _base = null; |
| 41 | ||
| 42 | ||
| 43 | /** |
|
| 44 | * <code>InitializationError</code> のインスタンスを作成します。 |
|
| 45 | */ |
|
| 46 | public InitializationError() |
|
| 47 | { |
|
| 48 | 0 | super(); |
| 49 | 0 | } |
| 50 | ||
| 51 | /** |
|
| 52 | * <code>InitializationError</code> のインスタンスを作成します。 |
|
| 53 | * @param message エラーメッセージ |
|
| 54 | */ |
|
| 55 | public InitializationError( String message ) |
|
| 56 | { |
|
| 57 | 0 | super( message ); |
| 58 | 0 | } |
| 59 | ||
| 60 | /** |
|
| 61 | * <code>InitializationError</code> のインスタンスを作成します。 |
|
| 62 | * @param e 基になる例外オブジェクト |
|
| 63 | */ |
|
| 64 | public InitializationError( Throwable e ) |
|
| 65 | { |
|
| 66 | 0 | super( e.getMessage() ); |
| 67 | 0 | _base = e; |
| 68 | 0 | } |
| 69 | ||
| 70 | /** |
|
| 71 | * <code>InitializationError</code> のインスタンスを作成します。 |
|
| 72 | * @param message エラーメッセージ |
|
| 73 | * @param e 基になる例外オブジェクト |
|
| 74 | */ |
|
| 75 | public InitializationError( String message, Throwable e ) |
|
| 76 | { |
|
| 77 | 0 | super( message ); |
| 78 | 0 | _base = e; |
| 79 | 0 | } |
| 80 | ||
| 81 | ||
| 82 | // |
|
| 83 | // Throwable の実装 |
|
| 84 | // |
|
| 85 | public void printStackTrace() |
|
| 86 | { |
|
| 87 | 0 | super.printStackTrace(); |
| 88 | 0 | if( _base != null ) { |
| 89 | 0 | System.err.println( "source exception: " + _base.getClass().getName() ); |
| 90 | 0 | _base.printStackTrace(); |
| 91 | } |
|
| 92 | 0 | } |
| 93 | ||
| 94 | public void printStackTrace( PrintStream ps ) |
|
| 95 | { |
|
| 96 | 0 | super.printStackTrace( ps ); |
| 97 | 0 | if( _base != null ) { |
| 98 | 0 | ps.println( "source exception: " + _base.getClass().getName() ); |
| 99 | 0 | _base.printStackTrace( ps ); |
| 100 | } |
|
| 101 | 0 | } |
| 102 | ||
| 103 | public void printStackTrace( PrintWriter pw ) |
|
| 104 | { |
|
| 105 | 0 | super.printStackTrace(); |
| 106 | 0 | if( _base != null ) { |
| 107 | 0 | pw.println( "source exception: " + _base.getClass().getName() ); |
| 108 | 0 | _base.printStackTrace( pw ); |
| 109 | } |
|
| 110 | 0 | } |
| 111 | } |
| This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |