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 @SuppressWarnings("unused")
48 @XmlAnyElement
49 private final Collection<Element> _futureElements = null;
50
51 private MovePoint() {
52 this.startNodeName = null;
53 this.stepsToMove = 0;
54 }
55
56 private MovePoint(String startNodeName, int stepsToMove) {
57 if (StringUtils.isBlank(startNodeName)) {
58 throw new IllegalArgumentException("startNodeName was null or blank");
59 }
60 this.startNodeName = startNodeName;
61 this.stepsToMove = stepsToMove;
62 }
63
64 public static MovePoint create(String startNodeName, int stepsToMove) {
65 return new MovePoint(startNodeName, stepsToMove);
66 }
67
68 public String getStartNodeName() {
69 return startNodeName;
70 }
71
72 public int getStepsToMove() {
73 return stepsToMove;
74 }
75
76
77
78
79 static class Constants {
80 final static String ROOT_ELEMENT_NAME = "movePoint";
81 final static String TYPE_NAME = "MovePointType";
82 }
83
84
85
86
87 static class Elements {
88 final static String START_NODE_NAME = "startNodeName";
89 final static String STEPS_TO_MOVE = "stepsToMove";
90 }
91
92 }