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 public class ConstraintValidationResult {
32
33 private String entryName;
34 private String attributeName;
35 private String attributePath;
36 private String constraintName;
37 private ErrorLevel level;
38
39 private String errorKey;
40 private String[] errorParameters;
41 private String constraintLabelKey;
42
43 private List<ConstraintValidationResult> children;
44
45
46 public ConstraintValidationResult(String constraintName) {
47 this.constraintName = constraintName;
48 this.children = new LinkedList<ConstraintValidationResult>();
49 this.level = ErrorLevel.OK;
50 }
51
52 public ConstraintValidationResult(String constraintName, ErrorLevel level) {
53 this.constraintName = constraintName;
54 this.children = new LinkedList<ConstraintValidationResult>();
55 this.level = level;
56 }
57
58 public void addChild(ConstraintValidationResult child) {
59 this.children.add(child);
60 }
61
62 public void setError(String errorKey, String... errorParameters) {
63 this.level = ErrorLevel.ERROR;
64 this.errorKey = errorKey;
65 this.errorParameters = errorParameters;
66 }
67
68 public void setWarning(String errorKey, String... errorParameters) {
69 this.level = ErrorLevel.WARN;
70 this.errorKey = errorKey;
71 this.errorParameters = errorParameters;
72 }
73
74
75
76
77 public ErrorLevel getStatus() {
78 return this.level;
79 }
80
81
82
83
84 public void setStatus(ErrorLevel level) {
85 this.level = level;
86 }
87
88
89
90
91 public String getErrorKey() {
92 return this.errorKey;
93 }
94
95
96
97
98 public void setErrorKey(String errorKey) {
99 this.errorKey = errorKey;
100 }
101
102
103
104
105 public String[] getErrorParameters() {
106 return this.errorParameters;
107 }
108
109
110
111
112 public void setErrorParameters(String[] errorParameters) {
113 this.errorParameters = errorParameters;
114 }
115
116
117
118
119 public String getEntryName() {
120 return this.entryName;
121 }
122
123
124
125
126 public void setEntryName(String entryName) {
127 this.entryName = entryName;
128 }
129
130
131
132
133 public String getAttributeName() {
134 return this.attributeName;
135 }
136
137
138
139
140 public void setAttributeName(String attributeName) {
141 this.attributeName = attributeName;
142 }
143
144
145
146
147 public String getConstraintName() {
148 return this.constraintName;
149 }
150
151
152
153
154 public void setConstraintName(String constraintName) {
155 this.constraintName = constraintName;
156 }
157
158
159
160
161 public List<ConstraintValidationResult> getChildren() {
162 return this.children;
163 }
164
165
166
167
168 public String getConstraintLabelKey() {
169 return this.constraintLabelKey;
170 }
171
172
173
174
175 public void setConstraintLabelKey(String constraintLabelKey) {
176 this.constraintLabelKey = constraintLabelKey;
177 }
178
179
180
181
182 public String getAttributePath() {
183 return this.attributePath;
184 }
185
186
187
188
189 public void setAttributePath(String attributePath) {
190 this.attributePath = attributePath;
191 }
192
193 }