1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api.document.attribute; |
17 | |
|
18 | |
import java.util.Collection; |
19 | |
|
20 | |
import javax.xml.bind.annotation.XmlAccessType; |
21 | |
import javax.xml.bind.annotation.XmlAccessorType; |
22 | |
import javax.xml.bind.annotation.XmlAnyElement; |
23 | |
import javax.xml.bind.annotation.XmlElement; |
24 | |
import javax.xml.bind.annotation.XmlRootElement; |
25 | |
import javax.xml.bind.annotation.XmlType; |
26 | |
|
27 | |
import org.apache.commons.lang.StringUtils; |
28 | |
import org.kuali.rice.core.api.CoreConstants; |
29 | |
import org.kuali.rice.core.api.mo.AbstractDataTransferObject; |
30 | |
import org.w3c.dom.Element; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
@XmlRootElement(name = WorkflowAttributeValidationError.Constants.ROOT_ELEMENT_NAME) |
38 | |
@XmlAccessorType(XmlAccessType.NONE) |
39 | |
@XmlType(name = WorkflowAttributeValidationError.Constants.TYPE_NAME, propOrder = { |
40 | |
WorkflowAttributeValidationError.Elements.KEY, |
41 | |
WorkflowAttributeValidationError.Elements.MESSAGE, |
42 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
43 | |
}) |
44 | |
public final class WorkflowAttributeValidationError extends AbstractDataTransferObject { |
45 | |
|
46 | |
private static final long serialVersionUID = 3323649177455266977L; |
47 | |
|
48 | |
@XmlElement(name = Elements.KEY, required = true) |
49 | |
private final String key; |
50 | |
|
51 | |
@XmlElement(name = Elements.MESSAGE, required = true) |
52 | |
private final String message; |
53 | |
|
54 | 0 | @SuppressWarnings("unused") |
55 | |
@XmlAnyElement |
56 | |
private final Collection<Element> _futureElements = null; |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | 0 | private WorkflowAttributeValidationError() { |
62 | 0 | this.key = null; |
63 | 0 | this.message = null; |
64 | 0 | } |
65 | |
|
66 | 0 | private WorkflowAttributeValidationError(String key, String message) { |
67 | 0 | if (StringUtils.isBlank(key)) { |
68 | 0 | throw new IllegalArgumentException("key was null or blank"); |
69 | |
} |
70 | 0 | if (StringUtils.isBlank(message)) { |
71 | 0 | throw new IllegalArgumentException("message was null or blank"); |
72 | |
} |
73 | 0 | this.key = key; |
74 | 0 | this.message = message; |
75 | 0 | } |
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
public static WorkflowAttributeValidationError create(String key, String message) { |
89 | 0 | return new WorkflowAttributeValidationError(key, message); |
90 | |
} |
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
public String getKey() { |
98 | 0 | return key; |
99 | |
} |
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | |
public String getMessage() { |
107 | 0 | return message; |
108 | |
} |
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | 0 | static class Constants { |
114 | |
final static String ROOT_ELEMENT_NAME = "workflowAttributeValidationError"; |
115 | |
final static String TYPE_NAME = "WorkflowAttributeValidationErrorType"; |
116 | |
} |
117 | |
|
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | 0 | static class Elements { |
123 | |
final static String KEY = "key"; |
124 | |
final static String MESSAGE = "message"; |
125 | |
} |
126 | |
|
127 | |
} |