1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.student.enrollment.acal.dto;
16
17 import java.io.Serializable;
18 import java.util.Date;
19 import java.util.List;
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.XmlType;
26
27 import org.kuali.student.enrollment.acal.infc.Term;
28 import org.kuali.student.r2.common.dto.IdEntityInfo;
29
30 import org.w3c.dom.Element;
31
32 @XmlAccessorType(XmlAccessType.FIELD)
33 @XmlType(name = "TermInfo", propOrder = {
34 "id", "typeKey", "stateKey", "name", "descr",
35 "code", "startDate", "endDate",
36 "meta", "attributes", "_futureElements"})
37
38 public class TermInfo
39 extends IdEntityInfo
40 implements Term, Serializable {
41
42 private static final long serialVersionUID = 1L;
43
44 @XmlElement
45 private String code;
46
47 @XmlElement
48 private Date startDate;
49
50 @XmlElement
51 private Date endDate;
52
53 @XmlAnyElement
54 private List<Element> _futureElements;
55
56
57
58
59 public TermInfo() {
60 }
61
62
63
64
65
66
67 public TermInfo(Term term) {
68 super(term);
69
70 if (term != null) {
71 this.code = term.getCode();
72 if (term.getStartDate() != null) {
73 this.startDate = new Date(term.getStartDate().getTime());
74 }
75
76 if (term.getEndDate() != null) {
77 this.endDate = new Date(term.getEndDate().getTime());
78 }
79 }
80 }
81
82 @Override
83 public String getCode() {
84 return code;
85 }
86
87 public void setCode(String code) {
88 this.code = code;
89 }
90
91 @Override
92 public Date getStartDate() {
93 return startDate;
94 }
95
96 public void setStartDate(Date startDate) {
97 this.startDate = startDate;
98 }
99
100 @Override
101 public Date getEndDate() {
102 return endDate;
103 }
104
105 public void setEndDate(Date endDate) {
106 this.endDate = endDate;
107 }
108 }