|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ModuleDataException.java | - | 50% | 50% | 50% |
|
||||||||||||||
| 1 | /* $Id: IllegalModuleDataException.java,v 1.7 2006/10/20 20:23:05 m31 Exp $ | |
| 2 | * | |
| 3 | * This file is part of the project "Hilbert II" - http://www.qedeq.org | |
| 4 | * | |
| 5 | * Copyright 2000-2006, Michael Meyling <mime@qedeq.org>. | |
| 6 | * | |
| 7 | * "Hilbert II" is free software; you can redistribute | |
| 8 | * it and/or modify it under the terms of the GNU General Public | |
| 9 | * License as published by the Free Software Foundation; either | |
| 10 | * version 2 of the License, or (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | */ | |
| 17 | ||
| 18 | package org.qedeq.kernel.bo.module; | |
| 19 | ||
| 20 | import org.qedeq.kernel.base.common.QedeqException; | |
| 21 | import org.qedeq.kernel.context.ModuleContext; | |
| 22 | ||
| 23 | /** | |
| 24 | * Data validation error for a QEDEQ module. An error has always a reference to its | |
| 25 | * location. Maybe n additional reference for another location is provided. | |
| 26 | * | |
| 27 | * @version $Revision: 1.7 $ | |
| 28 | * @author Michael Meyling | |
| 29 | */ | |
| 30 | public abstract class ModuleDataException extends QedeqException { | |
| 31 | ||
| 32 | /** Error location. */ | |
| 33 | private ModuleContext context; | |
| 34 | ||
| 35 | /** Reference location to explain the error. */ | |
| 36 | private ModuleContext referenceContext; | |
| 37 | ||
| 38 | /** | |
| 39 | * Constructor. | |
| 40 | * | |
| 41 | * @param errorCode Error code of this message. | |
| 42 | * @param message Error message. | |
| 43 | * @param context Error location. | |
| 44 | * @param referenceContext Reference location. | |
| 45 | * @param cause Detailed exception information. | |
| 46 | */ | |
| 47 | 2 | public ModuleDataException(final int errorCode, final String message, |
| 48 | final ModuleContext context, final ModuleContext referenceContext, | |
| 49 | final Exception cause) { | |
| 50 | 2 | super(errorCode, message, cause); |
| 51 | 2 | this.context = context; |
| 52 | 2 | this.referenceContext = referenceContext; |
| 53 | } | |
| 54 | ||
| 55 | /** | |
| 56 | * Constructor. | |
| 57 | * | |
| 58 | * @param errorCode Error code of this message. | |
| 59 | * @param message Error message. | |
| 60 | * @param context Error location. | |
| 61 | * @param referenceContext Reference location. | |
| 62 | */ | |
| 63 | 0 | public ModuleDataException(final int errorCode, final String message, |
| 64 | final ModuleContext context, final ModuleContext referenceContext) { | |
| 65 | 0 | super(errorCode, message); |
| 66 | 0 | this.context = context; |
| 67 | 0 | this.referenceContext = referenceContext; |
| 68 | } | |
| 69 | ||
| 70 | /** | |
| 71 | * Constructor. | |
| 72 | * | |
| 73 | * @param errorCode Error code of this message. | |
| 74 | * @param message Error message. | |
| 75 | * @param context Error location. | |
| 76 | * @param cause Detailed exception information. | |
| 77 | */ | |
| 78 | 0 | public ModuleDataException(final int errorCode, final String message, |
| 79 | final ModuleContext context, final Exception cause) { | |
| 80 | 0 | super(errorCode, message, cause); |
| 81 | 0 | this.context = context; |
| 82 | 0 | this.referenceContext = null; |
| 83 | } | |
| 84 | ||
| 85 | /** | |
| 86 | * Constructor. | |
| 87 | * | |
| 88 | * @param errorCode Error code of this message. | |
| 89 | * @param message Error message. | |
| 90 | * @param context Error location. | |
| 91 | */ | |
| 92 | 6539 | public ModuleDataException(final int errorCode, final String message, |
| 93 | final ModuleContext context) { | |
| 94 | 6539 | super(errorCode, message); |
| 95 | 6539 | this.context = context; |
| 96 | 6539 | this.referenceContext = null; |
| 97 | } | |
| 98 | ||
| 99 | /** | |
| 100 | * Get context information about error location. | |
| 101 | * | |
| 102 | * @return Error location context. | |
| 103 | */ | |
| 104 | 6 | public final ModuleContext getContext() { |
| 105 | 6 | return context; |
| 106 | } | |
| 107 | ||
| 108 | /** | |
| 109 | * Get additional context information about another associated location. | |
| 110 | * | |
| 111 | * @return Additional error location context. | |
| 112 | */ | |
| 113 | 0 | public final ModuleContext getReferenceContext() { |
| 114 | 0 | return referenceContext; |
| 115 | } | |
| 116 | ||
| 117 | } |
|
||||||||||