1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api.action; |
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 | |
@XmlRootElement(name = MovePoint.Constants.ROOT_ELEMENT_NAME) |
33 | |
@XmlAccessorType(XmlAccessType.NONE) |
34 | |
@XmlType(name = MovePoint.Constants.TYPE_NAME, propOrder = { |
35 | |
MovePoint.Elements.START_NODE_NAME, |
36 | |
MovePoint.Elements.STEPS_TO_MOVE, |
37 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
38 | |
}) |
39 | |
public final class MovePoint extends AbstractDataTransferObject { |
40 | |
|
41 | |
@XmlElement(name = Elements.START_NODE_NAME, required = true) |
42 | |
private final String startNodeName; |
43 | |
|
44 | |
@XmlElement(name = Elements.STEPS_TO_MOVE, required = true) |
45 | |
private final int stepsToMove; |
46 | |
|
47 | 0 | @SuppressWarnings("unused") |
48 | |
@XmlAnyElement |
49 | |
private final Collection<Element> _futureElements = null; |
50 | |
|
51 | 0 | private MovePoint() { |
52 | 0 | this.startNodeName = null; |
53 | 0 | this.stepsToMove = 0; |
54 | 0 | } |
55 | |
|
56 | 0 | private MovePoint(String startNodeName, int stepsToMove) { |
57 | 0 | if (StringUtils.isBlank(startNodeName)) { |
58 | 0 | throw new IllegalArgumentException("startNodeName was null or blank"); |
59 | |
} |
60 | 0 | this.startNodeName = startNodeName; |
61 | 0 | this.stepsToMove = stepsToMove; |
62 | 0 | } |
63 | |
|
64 | |
public static MovePoint create(String startNodeName, int stepsToMove) { |
65 | 0 | return new MovePoint(startNodeName, stepsToMove); |
66 | |
} |
67 | |
|
68 | |
public String getStartNodeName() { |
69 | 0 | return startNodeName; |
70 | |
} |
71 | |
|
72 | |
public int getStepsToMove() { |
73 | 0 | return stepsToMove; |
74 | |
} |
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | 0 | static class Constants { |
80 | |
final static String ROOT_ELEMENT_NAME = "movePoint"; |
81 | |
final static String TYPE_NAME = "MovePointType"; |
82 | |
} |
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | 0 | static class Elements { |
88 | |
final static String START_NODE_NAME = "startNodeName"; |
89 | |
final static String STEPS_TO_MOVE = "stepsToMove"; |
90 | |
} |
91 | |
|
92 | |
} |