Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DataModelProblemException |
|
| 1.0;1 |
1 | /* | |
2 | * Created on Aug 3, 2007 by wyatt | |
3 | */ | |
4 | package org.homeunix.thecave.buddi.plugin.api.exception; | |
5 | ||
6 | import org.homeunix.thecave.buddi.model.Document; | |
7 | ||
8 | /** | |
9 | * The primary exception thrown when there is a problem with the data model. | |
10 | * | |
11 | * It is recommended to throw the instance of the problem data model if at | |
12 | * all possible, as this helps in debugging. | |
13 | * | |
14 | * This extends RuntimeException, and thus should only be thrown if there is | |
15 | * no chance of recovery. | |
16 | * @author wyatt | |
17 | * | |
18 | */ | |
19 | public class DataModelProblemException extends RuntimeException { | |
20 | public static final long serialVersionUID = 0; | |
21 | ||
22 | private Document dataModel; | |
23 | ||
24 | public DataModelProblemException() { | |
25 | 0 | this(null, null, null); |
26 | 0 | } |
27 | public DataModelProblemException(String message) { | |
28 | 0 | this(message, null, null); |
29 | 0 | } |
30 | public DataModelProblemException(Throwable cause) { | |
31 | 0 | this(null, cause, null); |
32 | 0 | } |
33 | public DataModelProblemException(String message, Throwable cause) { | |
34 | 0 | this(message, cause, null); |
35 | 0 | } |
36 | /** | |
37 | * It is recommended to throw the instance of the problem data model if at | |
38 | * all possible, as this helps in debugging. | |
39 | * @param message | |
40 | * @param dataModel | |
41 | */ | |
42 | public DataModelProblemException(String message, Document dataModel){ | |
43 | 0 | this(message, null, dataModel); |
44 | 0 | } |
45 | /** | |
46 | * It is recommended to throw the instance of the problem data model if at | |
47 | * all possible, as this helps in debugging. | |
48 | * @param message | |
49 | * @param cause | |
50 | * @param dataModel | |
51 | */ | |
52 | public DataModelProblemException(String message, Throwable cause, Document dataModel){ | |
53 | 0 | super(message, cause); |
54 | ||
55 | 0 | this.dataModel = dataModel; |
56 | 0 | } |
57 | ||
58 | public Document getDataModel(){ | |
59 | 0 | return dataModel; |
60 | } | |
61 | } |