1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.api.action; |
18 | |
|
19 | |
import java.util.Collection; |
20 | |
|
21 | |
import javax.xml.bind.annotation.XmlAccessType; |
22 | |
import javax.xml.bind.annotation.XmlAccessorType; |
23 | |
import javax.xml.bind.annotation.XmlAnyElement; |
24 | |
import javax.xml.bind.annotation.XmlElement; |
25 | |
import javax.xml.bind.annotation.XmlRootElement; |
26 | |
import javax.xml.bind.annotation.XmlType; |
27 | |
|
28 | |
import org.kuali.rice.core.api.CoreConstants; |
29 | |
import org.kuali.rice.core.api.mo.AbstractDataTransferObject; |
30 | |
import org.kuali.rice.kew.api.document.Document; |
31 | |
import org.w3c.dom.Element; |
32 | |
|
33 | |
@XmlRootElement(name = DocumentActionResult.Constants.ROOT_ELEMENT_NAME) |
34 | |
@XmlAccessorType(XmlAccessType.NONE) |
35 | |
@XmlType(name = DocumentActionResult.Constants.TYPE_NAME, propOrder = { |
36 | |
DocumentActionResult.Elements.DOCUMENT, |
37 | |
DocumentActionResult.Elements.VALID_ACTIONS, |
38 | |
DocumentActionResult.Elements.REQUESTED_ACTIONS, |
39 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
40 | |
}) |
41 | |
public final class DocumentActionResult extends AbstractDataTransferObject { |
42 | |
|
43 | |
private static final long serialVersionUID = -3916503634900791018L; |
44 | |
|
45 | |
@XmlElement(name = Elements.DOCUMENT, required = true) |
46 | |
private final Document document; |
47 | |
|
48 | |
@XmlElement(name = Elements.VALID_ACTIONS, required = false) |
49 | |
private final ValidActions validActions; |
50 | |
|
51 | |
@XmlElement(name = Elements.REQUESTED_ACTIONS, required = false) |
52 | |
private final RequestedActions requestedActions; |
53 | |
|
54 | 0 | @SuppressWarnings("unused") |
55 | |
@XmlAnyElement |
56 | |
private final Collection<Element> _futureElements = null; |
57 | |
|
58 | 0 | private DocumentActionResult() { |
59 | 0 | this.document = null; |
60 | 0 | this.validActions = null; |
61 | 0 | this.requestedActions = null; |
62 | 0 | } |
63 | |
|
64 | 0 | private DocumentActionResult(Document document, ValidActions validActions, RequestedActions requestedActions) { |
65 | 0 | if (document == null) { |
66 | 0 | throw new IllegalArgumentException("document was null"); |
67 | |
} |
68 | 0 | this.document = document; |
69 | 0 | this.validActions = validActions; |
70 | 0 | this.requestedActions = requestedActions; |
71 | 0 | } |
72 | |
|
73 | |
public static DocumentActionResult create(Document document, ValidActions validActions, RequestedActions requestedActions) { |
74 | 0 | return new DocumentActionResult(document, validActions, requestedActions); |
75 | |
} |
76 | |
|
77 | |
public Document getDocument() { |
78 | 0 | return document; |
79 | |
} |
80 | |
|
81 | |
public ValidActions getValidActions() { |
82 | 0 | return validActions; |
83 | |
} |
84 | |
|
85 | |
public RequestedActions getRequestedActions() { |
86 | 0 | return requestedActions; |
87 | |
} |
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | 0 | static class Constants { |
93 | |
final static String ROOT_ELEMENT_NAME = "documentActionResult"; |
94 | |
final static String TYPE_NAME = "DocumentActionResultType"; |
95 | |
} |
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | 0 | static class Elements { |
101 | |
final static String DOCUMENT = "document"; |
102 | |
final static String VALID_ACTIONS = "validActions"; |
103 | |
final static String REQUESTED_ACTIONS = "requestedActions"; |
104 | |
} |
105 | |
|
106 | |
} |