1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.student.r2.core.state.dto; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.util.Date; |
21 | |
import java.util.List; |
22 | |
|
23 | |
import javax.xml.bind.annotation.XmlAccessType; |
24 | |
import javax.xml.bind.annotation.XmlAccessorType; |
25 | |
import javax.xml.bind.annotation.XmlAnyElement; |
26 | |
import javax.xml.bind.annotation.XmlAttribute; |
27 | |
import javax.xml.bind.annotation.XmlElement; |
28 | |
import javax.xml.bind.annotation.XmlType; |
29 | |
|
30 | |
import org.kuali.student.r2.core.state.infc.State; |
31 | |
import org.kuali.student.r2.common.dto.HasAttributesAndMetaInfo; |
32 | |
import org.kuali.student.r2.common.dto.RichTextInfo; |
33 | |
import org.w3c.dom.Element; |
34 | |
|
35 | 0 | @XmlAccessorType(XmlAccessType.FIELD) |
36 | |
@XmlType(name = "StateInfo", propOrder = { |
37 | |
"key", "name", "descr", "lifecycleKey", |
38 | |
"effectiveDate", "expirationDate", |
39 | |
"meta", "attributes", "_futureElements"}) |
40 | |
|
41 | |
public class StateInfo |
42 | |
extends HasAttributesAndMetaInfo |
43 | |
implements State, Serializable { |
44 | |
|
45 | |
private static final long serialVersionUID = 1L; |
46 | |
|
47 | |
@XmlAttribute |
48 | |
private String key; |
49 | |
|
50 | |
@XmlElement |
51 | |
private String name; |
52 | |
|
53 | |
@XmlElement |
54 | |
private RichTextInfo descr; |
55 | |
|
56 | |
@XmlAttribute |
57 | |
private String lifecycleKey; |
58 | |
|
59 | |
@XmlElement |
60 | |
private Date effectiveDate; |
61 | |
|
62 | |
@XmlElement |
63 | |
private Date expirationDate; |
64 | |
|
65 | |
@XmlAnyElement |
66 | |
private List<Element> _futureElements; |
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | 0 | public StateInfo() { |
73 | 0 | } |
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
public StateInfo(State state) { |
80 | 0 | super(state); |
81 | |
|
82 | 0 | if(state != null) { |
83 | 0 | this.key = state.getKey(); |
84 | 0 | this.name = state.getName(); |
85 | 0 | if (state.getDescr() != null) { |
86 | 0 | this.descr = new RichTextInfo(state.getDescr()); |
87 | |
} |
88 | |
|
89 | 0 | this.lifecycleKey = state.getLifecycleKey(); |
90 | 0 | this.effectiveDate = null != state.getEffectiveDate() ? new Date(state.getEffectiveDate().getTime()) : null; |
91 | 0 | this.expirationDate = null != state.getExpirationDate() ? new Date(state.getExpirationDate().getTime()) : null; |
92 | |
} |
93 | 0 | } |
94 | |
|
95 | |
@Override |
96 | |
public String getKey() { |
97 | 0 | return key; |
98 | |
} |
99 | |
|
100 | |
public void setKey(String key) { |
101 | 0 | this.key = key; |
102 | 0 | } |
103 | |
|
104 | |
@Override |
105 | |
public String getName() { |
106 | 0 | return name; |
107 | |
} |
108 | |
|
109 | |
public void setName(String name) { |
110 | 0 | this.name = name; |
111 | 0 | } |
112 | |
|
113 | |
@Override |
114 | |
public RichTextInfo getDescr() { |
115 | 0 | return descr; |
116 | |
} |
117 | |
|
118 | |
public void setDescr(RichTextInfo descr) { |
119 | 0 | this.descr = descr; |
120 | 0 | } |
121 | |
|
122 | |
@Override |
123 | |
public String getLifecycleKey() { |
124 | 0 | return lifecycleKey; |
125 | |
} |
126 | |
|
127 | |
public void setLifecycleKey(String lifecycleKey) { |
128 | 0 | this.lifecycleKey = lifecycleKey; |
129 | 0 | } |
130 | |
|
131 | |
@Override |
132 | |
public Date getEffectiveDate() { |
133 | 0 | return effectiveDate; |
134 | |
} |
135 | |
|
136 | |
public void setEffectiveDate(Date effectiveDate) { |
137 | 0 | this.effectiveDate = effectiveDate; |
138 | 0 | } |
139 | |
|
140 | |
@Override |
141 | |
public Date getExpirationDate() { |
142 | 0 | return expirationDate; |
143 | |
} |
144 | |
|
145 | |
public void setExpirationDate(Date expirationDate) { |
146 | 0 | this.expirationDate = expirationDate; |
147 | 0 | } |
148 | |
} |