1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api.doctype; |
17 | |
|
18 | |
import javax.xml.bind.annotation.XmlEnum; |
19 | |
import javax.xml.bind.annotation.XmlEnumValue; |
20 | |
import javax.xml.bind.annotation.XmlRootElement; |
21 | |
import javax.xml.bind.annotation.XmlType; |
22 | |
|
23 | |
import org.kuali.rice.core.api.mo.common.Coded; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | 3 | @XmlRootElement(name = "documentTypePolicy") |
31 | |
@XmlType(name = "DocumentTypePolicyType") |
32 | |
@XmlEnum |
33 | |
public enum DocumentTypePolicy implements Coded { |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | 1 | @XmlEnumValue(Codes.DISAPPROVE) DISAPPROVE(Codes.DISAPPROVE), |
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | 1 | @XmlEnumValue(Codes.USE_KEW_SUPERUSER_DOCHANDLER) USE_KEW_SUPERUSER_DOCHANDLER(Codes.USE_KEW_SUPERUSER_DOCHANDLER), |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | 1 | @XmlEnumValue(Codes.ALLOW_UNREQUESTED_ACTION) ALLOW_UNREQUESTED_ACTION(Codes.ALLOW_UNREQUESTED_ACTION), |
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | 1 | @XmlEnumValue(Codes.DEFAULT_APPROVE) DEFAULT_APPROVE(Codes.DEFAULT_APPROVE), |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | 1 | @XmlEnumValue(Codes.INITIATOR_MUST_ROUTE) INITIATOR_MUST_ROUTE(Codes.INITIATOR_MUST_ROUTE), |
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | 1 | @XmlEnumValue(Codes.INITIATOR_MUST_SAVE) INITIATOR_MUST_SAVE(Codes.INITIATOR_MUST_SAVE), |
77 | |
|
78 | 1 | @XmlEnumValue(Codes.INITIATOR_MUST_CANCEL) INITIATOR_MUST_CANCEL(Codes.INITIATOR_MUST_CANCEL), |
79 | |
|
80 | 1 | @XmlEnumValue(Codes.INITIATOR_MUST_BLANKET_APPROVE) INITIATOR_MUST_BLANKET_APPROVE(Codes.INITIATOR_MUST_BLANKET_APPROVE), |
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | 1 | @XmlEnumValue(Codes.LOOK_FUTURE) LOOK_FUTURE(Codes.LOOK_FUTURE), |
89 | |
|
90 | 1 | @XmlEnumValue(Codes.SEND_NOTIFICATION_ON_SU_APPROVE) SEND_NOTIFICATION_ON_SU_APPROVE(Codes.SEND_NOTIFICATION_ON_SU_APPROVE), |
91 | |
|
92 | 1 | @XmlEnumValue(Codes.SUPPORTS_QUICK_INITIATE) SUPPORTS_QUICK_INITIATE(Codes.SUPPORTS_QUICK_INITIATE), |
93 | |
|
94 | 1 | @XmlEnumValue(Codes.NOTIFY_ON_SAVE) NOTIFY_ON_SAVE(Codes.NOTIFY_ON_SAVE), |
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | 1 | @XmlEnumValue(Codes.DOCUMENT_STATUS_POLICY) DOCUMENT_STATUS_POLICY(Codes.DOCUMENT_STATUS_POLICY), |
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | 1 | @XmlEnumValue(Codes.ALLOW_SU_POSTPROCESSOR_OVERRIDE) ALLOW_SU_POSTPROCESSOR_OVERRIDE(Codes.ALLOW_SU_POSTPROCESSOR_OVERRIDE), |
107 | |
|
108 | 1 | @XmlEnumValue(Codes.FAIL_ON_INACTIVE_GROUP) FAIL_ON_INACTIVE_GROUP(Codes.FAIL_ON_INACTIVE_GROUP), |
109 | |
|
110 | 1 | @XmlEnumValue(Codes.REGENERATE_ACTION_REQUESTS_ON_CHANGE) REGENERATE_ACTION_REQUESTS_ON_CHANGE(Codes.REGENERATE_ACTION_REQUESTS_ON_CHANGE); |
111 | |
|
112 | |
|
113 | |
private final String code; |
114 | |
|
115 | 16 | private DocumentTypePolicy(String code) { |
116 | 16 | this.code = code; |
117 | 16 | } |
118 | |
|
119 | |
@Override |
120 | |
public String getCode() { |
121 | 1 | return code; |
122 | |
} |
123 | |
|
124 | |
public static DocumentTypePolicy fromCode(String code) { |
125 | 2 | if (code == null) { |
126 | 0 | return null; |
127 | |
} |
128 | 8 | for (DocumentTypePolicy policy : values()) { |
129 | 8 | if (policy.code.equals(code)) { |
130 | 2 | return policy; |
131 | |
} |
132 | |
} |
133 | 0 | throw new IllegalArgumentException("Failed to locate the DocumentTypePolicy with the given code: " + code); |
134 | |
} |
135 | |
|
136 | 0 | private static final class Codes { |
137 | |
private static final String DISAPPROVE = "DISAPPROVE"; |
138 | |
private static final String USE_KEW_SUPERUSER_DOCHANDLER = "USE_KEW_SUPERUSER_DOCHANDLER"; |
139 | |
private static final String ALLOW_UNREQUESTED_ACTION = "ALLOW_UNREQUESTED_ACTION"; |
140 | |
private static final String DEFAULT_APPROVE = "DEFAULT_APPROVE"; |
141 | |
private static final String INITIATOR_MUST_ROUTE = "INITIATOR_MUST_ROUTE"; |
142 | |
private static final String INITIATOR_MUST_SAVE = "INITIATOR_MUST_SAVE"; |
143 | |
private static final String INITIATOR_MUST_CANCEL = "INITIATOR_MUST_CANCEL"; |
144 | |
private static final String INITIATOR_MUST_BLANKET_APPROVE = "INITIATOR_MUST_BLANKET_APPROVE"; |
145 | |
private static final String LOOK_FUTURE = "LOOK_FUTURE"; |
146 | |
private static final String SEND_NOTIFICATION_ON_SU_APPROVE = "SEND_NOTIFICATION_ON_SU_APPROVE"; |
147 | |
private static final String SUPPORTS_QUICK_INITIATE = "SUPPORTS_QUICK_INITIATE"; |
148 | |
private static final String NOTIFY_ON_SAVE = "NOTIFY_ON_SAVE"; |
149 | |
private static final String DOCUMENT_STATUS_POLICY = "DOCUMENT_STATUS_POLICY"; |
150 | |
private static final String ALLOW_SU_POSTPROCESSOR_OVERRIDE = "ALLOW_SU_POSTPROCESSOR_OVERRIDE"; |
151 | |
private static final String FAIL_ON_INACTIVE_GROUP = "FAIL_ON_INACTIVE_GROUP"; |
152 | |
private static final String REGENERATE_ACTION_REQUESTS_ON_CHANGE = "REGENERATE_ACTION_REQUESTS_ON_CHANGE"; |
153 | |
} |
154 | |
|
155 | |
} |