1
2
3
4
5
6
7
8
9
10 package pt.digitalis.dif.exception.objects;
11
12 import pt.digitalis.dif.controller.interfaces.IDIFContext;
13 import pt.digitalis.dif.dem.interfaces.IStage;
14 import pt.digitalis.dif.dem.objects.parameters.IParameter;
15 import pt.digitalis.dif.exception.DIFException;
16
17
18
19
20
21
22 public class ParameterException extends DIFException {
23
24
25 private static final long serialVersionUID = -3450110830894378355L;
26
27
28 final static private String PARAMETER = "PARAMETER";
29
30
31 final static private String CONTEXT = "CONTEXT";
32
33
34 final static private String STAGE = "STAGE";
35
36
37
38
39
40
41
42
43
44 public ParameterException(String reason, IParameter<?> parameter) {
45 super(reason);
46 setParameter(parameter);
47 }
48
49
50
51
52
53
54
55
56
57
58
59 public ParameterException(String reason, Exception exception, IParameter<?> parameter) {
60 super(reason, exception);
61 setParameter(parameter);
62 }
63
64
65
66
67
68 public void setParameter(IParameter<?> parameter) {
69 addToExceptionContext(PARAMETER, parameter);
70 }
71
72
73
74
75
76 public void setStage(IStage stage) {
77 addToExceptionContext(STAGE, stage);
78 }
79
80
81
82
83
84 public void setContext(IDIFContext context) {
85 addToExceptionContext(CONTEXT, context);
86 }
87 }