1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.datadictionary.validation.result;
17
18 import org.kuali.rice.krad.datadictionary.validation.ErrorLevel;
19 import org.kuali.rice.krad.datadictionary.validation.constraint.Constraint;
20 import org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor;
21
22 import java.util.LinkedList;
23 import java.util.List;
24
25
26
27
28
29
30
31
32 public class ConstraintValidationResult {
33
34 private String entryName;
35 private String attributeName;
36 private String attributePath;
37 private String constraintName;
38 private ErrorLevel level;
39
40 private String errorKey;
41 private String[] errorParameters = {};
42 private String constraintLabelKey;
43
44 private List<ConstraintValidationResult> children;
45
46
47
48
49
50
51 public ConstraintValidationResult(String constraintName) {
52 this.constraintName = constraintName;
53 this.children = new LinkedList<ConstraintValidationResult>();
54 this.level = ErrorLevel.OK;
55 }
56
57
58
59
60
61
62
63 public ConstraintValidationResult(String constraintName, ErrorLevel level) {
64 this.constraintName = constraintName;
65 this.children = new LinkedList<ConstraintValidationResult>();
66 this.level = level;
67 }
68
69
70
71
72
73
74 public void addChild(ConstraintValidationResult child) {
75 this.children.add(child);
76 }
77
78
79
80
81
82
83
84 public void setError(String errorKey, String... errorParameters) {
85 this.level = ErrorLevel.ERROR;
86 this.errorKey = errorKey;
87 this.errorParameters = errorParameters;
88 }
89
90
91
92
93
94
95
96 public void setWarning(String errorKey, String... errorParameters) {
97 this.level = ErrorLevel.WARN;
98 this.errorKey = errorKey;
99 this.errorParameters = errorParameters;
100 }
101
102
103
104
105 public ErrorLevel getStatus() {
106 return this.level;
107 }
108
109
110
111
112 public void setStatus(ErrorLevel level) {
113 this.level = level;
114 }
115
116
117
118
119
120
121
122 public String getErrorKey() {
123 return this.errorKey;
124 }
125
126
127
128
129 public void setErrorKey(String errorKey) {
130 this.errorKey = errorKey;
131 }
132
133
134
135
136 public String[] getErrorParameters() {
137 return this.errorParameters;
138 }
139
140
141
142
143 public void setErrorParameters(String[] errorParameters) {
144 this.errorParameters = errorParameters;
145 }
146
147
148
149
150 public String getEntryName() {
151 return this.entryName;
152 }
153
154
155
156
157 public void setEntryName(String entryName) {
158 this.entryName = entryName;
159 }
160
161
162
163
164 public String getAttributeName() {
165 return this.attributeName;
166 }
167
168
169
170
171 public void setAttributeName(String attributeName) {
172 this.attributeName = attributeName;
173 }
174
175
176
177
178 public String getConstraintName() {
179 return this.constraintName;
180 }
181
182
183
184
185 public void setConstraintName(String constraintName) {
186 this.constraintName = constraintName;
187 }
188
189
190
191
192 public List<ConstraintValidationResult> getChildren() {
193 return this.children;
194 }
195
196
197
198
199 public String getConstraintLabelKey() {
200 return this.constraintLabelKey;
201 }
202
203
204
205
206 public void setConstraintLabelKey(String constraintLabelKey) {
207 this.constraintLabelKey = constraintLabelKey;
208 }
209
210
211
212
213 public String getAttributePath() {
214 return this.attributePath;
215 }
216
217
218
219
220 public void setAttributePath(String attributePath) {
221 this.attributePath = attributePath;
222 }
223
224 }