Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../img/srcFileCovDistChart7.png 62% of files have more coverage
14   120   6   2,33
12   38   0,43   6
6     1  
1    
 
  ModuleDataException       Line # 27 14 6 65,6% 0.65625
 
  (29)
 
1    /* $Id: ModuleDataException.java,v 1.1 2008/03/27 05:16:25 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, 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.common;
19   
20    /**
21    * Data validation error for a QEDEQ module. An error has always a reference to its
22    * location. Maybe an additional reference for another location is provided.
23    *
24    * @version $Revision: 1.1 $
25    * @author Michael Meyling
26    */
 
27    public abstract class ModuleDataException extends QedeqException {
28   
29    /** Error location. */
30    private ModuleContext context;
31   
32    /** Reference location to explain the error. */
33    private ModuleContext referenceContext;
34   
35    /**
36    * Constructor.
37    *
38    * @param errorCode Error code of this message.
39    * @param message Error message.
40    * @param context Error location.
41    * @param referenceContext Reference location.
42    * @param cause Detailed exception information.
43    */
 
44  3 toggle public ModuleDataException(final int errorCode, final String message,
45    final ModuleContext context, final ModuleContext referenceContext,
46    final Exception cause) {
47  3 super(errorCode, message, cause);
48    // use copy constructor
49  3 this.context = (context == null ? null : new ModuleContext(context));
50  3 this.referenceContext = (referenceContext == null ? null
51    : new ModuleContext(referenceContext));
52    }
53   
54    /**
55    * Constructor.
56    *
57    * @param errorCode Error code of this message.
58    * @param message Error message.
59    * @param context Error location.
60    * @param referenceContext Reference location.
61    */
 
62  2 toggle public ModuleDataException(final int errorCode, final String message,
63    final ModuleContext context, final ModuleContext referenceContext) {
64  2 super(errorCode, message);
65    // use copy constructor
66  2 this.context = (context == null ? null : new ModuleContext(context));
67  2 this.referenceContext = (referenceContext == null ? null
68    : new ModuleContext(referenceContext));
69    }
70   
71    /**
72    * Constructor.
73    *
74    * @param errorCode Error code of this message.
75    * @param message Error message.
76    * @param context Error location.
77    * @param cause Detailed exception information.
78    */
 
79  0 toggle public ModuleDataException(final int errorCode, final String message,
80    final ModuleContext context, final Exception cause) {
81  0 super(errorCode, message, cause);
82    // use copy constructor
83  0 this.context = (context == null ? null : new ModuleContext(context));
84  0 this.referenceContext = null;
85    }
86   
87    /**
88    * Constructor.
89    *
90    * @param errorCode Error code of this message.
91    * @param message Error message.
92    * @param context Error location.
93    */
 
94  32792 toggle public ModuleDataException(final int errorCode, final String message,
95    final ModuleContext context) {
96  32792 super(errorCode, message);
97    // use copy constructor
98  32792 this.context = (context == null ? null : new ModuleContext(context));
99  32792 this.referenceContext = null;
100    }
101   
102    /**
103    * Get context information about error location.
104    *
105    * @return Error location context.
106    */
 
107  134 toggle public final ModuleContext getContext() {
108  134 return context;
109    }
110   
111    /**
112    * Get additional context information about another associated location.
113    *
114    * @return Additional error location context.
115    */
 
116  134 toggle public final ModuleContext getReferenceContext() {
117  134 return referenceContext;
118    }
119   
120    }