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