View Javadoc

1   /*
2    * Copyright 2011 The Kuali Foundation 
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License. You may obtain a copy of the License at
7    *
8    * http://www.osedu.org/licenses/ECL-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13   * implied. See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  
17  package org.kuali.student.enrollment.courseregistration.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.XmlElement;
27  import javax.xml.bind.annotation.XmlType;
28  
29  import org.kuali.rice.core.api.util.type.KualiDecimal;
30  
31  import org.kuali.student.enrollment.courseregistration.infc.CourseRegistration;
32  import org.kuali.student.r2.common.dto.RelationshipInfo;
33  
34  import org.w3c.dom.Element;
35  
36  @XmlAccessorType(XmlAccessType.FIELD)
37  @XmlType(name = "CourseRegistrationInfo", propOrder = {
38          "id",
39          "typeKey",
40          "stateKey",
41          "personId",
42          "termId",
43          "courseOfferingId",
44          "registrationGroupId",
45          "credits",
46          "gradingOptionId",
47          "crossListedCode",
48          "lastAttendanceDate",
49          "effectiveDate",
50          "expirationDate",
51          "meta",
52          "attributes",
53          "_futureElements"})
54  
55  public class CourseRegistrationInfo
56          extends RelationshipInfo
57          implements CourseRegistration, Serializable {
58  
59      private static final long serialVersionUID = 1L;
60  
61      @XmlElement
62      private String personId;
63  
64      @XmlElement
65      private String termId;
66  
67      @XmlElement
68      private String courseOfferingId;
69  
70      @XmlElement
71      private String registrationGroupId;
72  
73      @XmlElement
74      private KualiDecimal credits;
75  
76      @XmlElement
77      private String gradingOptionId;
78  
79      @XmlElement
80      private String crossListedCode;
81  
82      @XmlElement
83      private Date lastAttendanceDate;
84  
85      @XmlAnyElement
86      private List<Element> _futureElements;
87  
88  
89      /**
90       * Constructs a new CourseRegistrationInfo.
91       */
92      public CourseRegistrationInfo() {
93      }
94  
95      /**
96       * Constructs a new CourseRegistrationInfo from another
97       * CourseRegistration.
98       *
99       * @param courseRegistration the CourseRegistration to copy
100      */
101     public CourseRegistrationInfo(CourseRegistration courseRegistration) {
102         super(courseRegistration);
103 
104         if (courseRegistration != null) {
105             this.personId = courseRegistration.getPersonId();
106             this.termId = courseRegistration.getTermId();
107             this.courseOfferingId = courseRegistration.getCourseOfferingId();
108             this.registrationGroupId = courseRegistration.getRegistrationGroupId();
109             this.credits = new KualiDecimal(courseRegistration.getCredits().bigDecimalValue());
110             this.gradingOptionId = courseRegistration.getGradingOptionId();
111             this.crossListedCode = courseRegistration.getCrossListedCode();
112             this.lastAttendanceDate = courseRegistration.getLastAttendanceDate();
113         }
114     }
115 
116     @Override
117     public String getPersonId() {
118         return personId;
119     }
120 
121     public void setPersonId(String studentId) {
122         this.personId = studentId;
123     }
124 
125     @Override
126     public String getTermId() {
127         return termId;
128     }
129 
130     public void setTermId(String termId) {
131         this.termId = termId;
132     }
133 
134     @Override
135     public String getCourseOfferingId() {
136         return courseOfferingId;
137     }
138 
139     public void setCourseOfferingId(String courseOfferingId) {
140         this.courseOfferingId = courseOfferingId;
141     }
142 
143     @Override
144     public String getRegistrationGroupId() {
145         return registrationGroupId;
146     }
147 
148     public void setRegistrationGroupId(String registrationGroupId) {
149         this.registrationGroupId = registrationGroupId;
150     }
151 
152     @Override
153     public KualiDecimal getCredits() {
154         return credits;
155     }
156 
157     public void setCredits(KualiDecimal credits) {
158         this.credits = credits;
159     }
160 
161     @Override
162     public String getGradingOptionId() {
163         return gradingOptionId;
164     }
165 
166     public void setGradingOptionId(String gradingOptionId) {
167         this.gradingOptionId = gradingOptionId;
168     }
169 
170     @Override
171     public String getCrossListedCode() {
172         return crossListedCode;
173     }
174 
175     public void setCrossListedCode(String crossListedCode) {
176         this.crossListedCode = crossListedCode;
177     }
178 
179     @Override
180     public Date getLastAttendanceDate() {
181         return lastAttendanceDate;
182     }
183 
184     public void setLastAttendanceDate(Date lastAttendanceDate) {
185         this.lastAttendanceDate = lastAttendanceDate;
186     }
187 }