Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
WorkflowAttributeValidationError |
|
| 1.2222222222222223;1.222 |
1 | /* | |
2 | * Copyright 2005-2007 The Kuali Foundation | |
3 | * | |
4 | * | |
5 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.opensource.org/licenses/ecl2.php | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
17 | package org.kuali.rice.kew.rule; | |
18 | ||
19 | import java.io.Serializable; | |
20 | import java.util.Map; | |
21 | ||
22 | import org.kuali.rice.kew.docsearch.SearchableAttribute; | |
23 | import org.kuali.rice.krad.util.MessageMap; | |
24 | ||
25 | ||
26 | /** | |
27 | * An error returned from the validation of a {@link WorkflowAttribute}. | |
28 | * Returned by a call to {@link WorkflowAttributeXmlValidator#validateClientRoutingData()} | |
29 | * and {@link SearchableAttribute#validateUserSearchInputs(Map)} | |
30 | * | |
31 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
32 | */ | |
33 | public class WorkflowAttributeValidationError implements Serializable { | |
34 | ||
35 | private static final long serialVersionUID = 6785629049454272657L; | |
36 | ||
37 | private MessageMap messageMap; | |
38 | ||
39 | private String key; | |
40 | private String message; | |
41 | ||
42 | 0 | public WorkflowAttributeValidationError(String key, String message) { |
43 | 0 | this.key = key; |
44 | 0 | this.message = message; |
45 | 0 | } |
46 | ||
47 | 0 | public WorkflowAttributeValidationError(String key, String message, MessageMap messageMap) { |
48 | 0 | this.key = key; |
49 | 0 | this.message = message; |
50 | 0 | this.messageMap = messageMap; |
51 | 0 | } |
52 | ||
53 | /** | |
54 | * @param key The key to set. | |
55 | */ | |
56 | public void setKey(String key) { | |
57 | 0 | this.key = key; |
58 | 0 | } |
59 | ||
60 | /** | |
61 | * @return Returns the key. | |
62 | */ | |
63 | public String getKey() { | |
64 | 0 | return key; |
65 | } | |
66 | ||
67 | /** | |
68 | * @param message The message to set. | |
69 | */ | |
70 | public void setMessage(String message) { | |
71 | 0 | this.message = message; |
72 | 0 | } |
73 | ||
74 | /** | |
75 | * @return Returns the message. | |
76 | */ | |
77 | public String getMessage() { | |
78 | 0 | return message; |
79 | } | |
80 | ||
81 | /** | |
82 | * @return the messageMap | |
83 | */ | |
84 | public MessageMap getMessageMap() { | |
85 | 0 | return this.messageMap; |
86 | } | |
87 | ||
88 | /** | |
89 | * @param messageMap the messageMap to set | |
90 | */ | |
91 | public void setMessageMap(MessageMap messageMap) { | |
92 | 0 | this.messageMap = messageMap; |
93 | 0 | } |
94 | ||
95 | public static org.kuali.rice.kew.api.document.WorkflowAttributeValidationError to(WorkflowAttributeValidationError validationError) { | |
96 | 0 | if (validationError == null) { |
97 | 0 | return null; |
98 | } | |
99 | 0 | return org.kuali.rice.kew.api.document.WorkflowAttributeValidationError.create(validationError.getKey(), validationError.getMessage()); |
100 | } | |
101 | ||
102 | } |