View Javadoc

1   /*
2    * Copyright 2009 The Kuali Foundation Licensed under the Educational Community
3    * License, Version 1.0 (the "License"); you may not use this file except in
4    * compliance with the License. You may obtain a copy of the License at
5    * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law
6    * or agreed to in writing, software distributed under the License is
7    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8    * KIND, either express or implied. See the License for the specific language
9    * governing permissions and limitations under the License.
10   */
11  package org.kuali.student.r2.lum.program.dto;
12  
13  import java.io.Serializable;
14  import java.util.ArrayList;
15  
16  import java.util.List;
17  
18  import javax.xml.bind.annotation.XmlAccessType;
19  import javax.xml.bind.annotation.XmlAccessorType;
20  import javax.xml.bind.annotation.XmlAnyElement;
21  import javax.xml.bind.annotation.XmlElement;
22  import javax.xml.bind.annotation.XmlType;
23  
24  import org.kuali.student.r2.common.dto.IdNamelessEntityInfo;
25  import org.kuali.student.r2.lum.program.infc.MinorDiscipline;
26  //import org.w3c.dom.Element;
27  
28  
29  @XmlType(name = "MinorDisciplineInfo", propOrder = {"id",
30      "typeKey",
31      "stateKey",
32      "credentialProgramId",
33      "programRequirements",
34      "meta",
35      "attributes" , "_futureElements" }) 
36      
37  @XmlAccessorType(XmlAccessType.FIELD)
38  public class MinorDisciplineInfo extends IdNamelessEntityInfo implements MinorDiscipline, Serializable {
39      
40      private static final long serialVersionUID = 1L;
41      @XmlElement
42      private String credentialProgramId;
43      @XmlElement
44      private List<String> programRequirements;
45      @XmlAnyElement
46      private List<Object> _futureElements;  
47      
48      public MinorDisciplineInfo() {
49          this.programRequirements = new ArrayList<String>();
50      }
51      
52      public MinorDisciplineInfo(MinorDiscipline minorDiscipline) {
53          super (minorDiscipline);
54          if (minorDiscipline != null) {
55              this.credentialProgramId = minorDiscipline.getCredentialProgramId();
56              this.programRequirements = minorDiscipline.getProgramRequirements() != null 
57                      ? new ArrayList<String>(minorDiscipline.getProgramRequirements()) 
58                      : new ArrayList<String>();
59          }
60      }
61  
62      /**
63       * Identifier of the credential program under which the honors belongs
64       */
65      @Override
66      public String getCredentialProgramId() {
67          return credentialProgramId;
68      }
69      
70      public void setCredentialProgramId(String credentialProgramId) {
71          this.credentialProgramId = credentialProgramId;
72      }
73      
74      @Override
75      public List<String> getProgramRequirements() {
76          if (programRequirements == null) {
77              programRequirements = new ArrayList<String>(0);
78          }
79          return programRequirements;
80      }
81      
82      public void setProgramRequirements(List<String> programRequirements) {
83          this.programRequirements = programRequirements;
84      }
85  
86    
87  }