View Javadoc

1   /*
2    * Copyright 2009 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 1.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
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 implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.r2.lum.clu.dto;
17  
18  import org.kuali.student.r2.common.dto.CurrencyAmountInfo;
19  import org.kuali.student.r2.common.dto.HasAttributesAndMetaInfo;
20  import org.kuali.student.r2.common.dto.RichTextInfo;
21  import org.kuali.student.r2.common.infc.CurrencyAmount;
22  import org.kuali.student.r2.lum.clu.infc.Fee;
23  //import org.w3c.dom.Element;
24  
25  import javax.xml.bind.annotation.XmlAccessType;
26  import javax.xml.bind.annotation.XmlAccessorType;
27  import javax.xml.bind.annotation.XmlAnyElement;
28  import javax.xml.bind.annotation.XmlAttribute;
29  import javax.xml.bind.annotation.XmlElement;
30  import javax.xml.bind.annotation.XmlType;
31  import java.io.Serializable;
32  import java.util.ArrayList;
33  import java.util.List;
34  
35  
36  @XmlAccessorType(XmlAccessType.FIELD)
37  @XmlType(name = "FeeInfo", propOrder = {"feeType", "rateType", "feeAmounts",
38          "descr", "key", "meta", "attributes" , "_futureElements" }) 
39  public class FeeInfo extends HasAttributesAndMetaInfo implements Fee, Serializable {
40  
41      private static final long serialVersionUID = 1L;
42  
43      @XmlElement
44      private String feeType;
45      @XmlElement
46      private String rateType;
47      @XmlElement
48      private List<CurrencyAmountInfo> feeAmounts;
49      @XmlElement
50      private RichTextInfo descr;
51      @XmlAttribute
52      private String key;
53      @XmlAnyElement
54      private List<Object> _futureElements;  
55  
56      public FeeInfo() {
57          this.feeAmounts = new ArrayList<CurrencyAmountInfo>();
58      }
59  
60      public FeeInfo(Fee fee) {
61          super(fee);
62          if (null != fee) {
63              this.feeType = fee.getFeeType();
64              this.rateType = fee.getRateType();
65              this.feeAmounts = new ArrayList<CurrencyAmountInfo>();
66              for (CurrencyAmount currencyAmount : fee.getFeeAmounts()) {
67                  this.feeAmounts.add(new CurrencyAmountInfo(currencyAmount));
68              }
69              this.key = fee.getKey();
70              this.descr = (null != fee.getDescr()) ? new RichTextInfo(fee.getDescr()) : null;
71          }
72      }
73  
74      @Override
75      public String getFeeType() {
76          return feeType;
77      }
78  
79      public void setFeeType(String feeType) {
80          this.feeType = feeType;
81      }
82  
83  
84      @Override
85      public String getRateType() {
86          return rateType;
87      }
88  
89      public void setRateType(String rateType) {
90          this.rateType = rateType;
91      }
92  
93      @Override
94      public List<CurrencyAmountInfo> getFeeAmounts() {
95          if (feeAmounts == null) {
96              feeAmounts = new ArrayList<CurrencyAmountInfo>(0);
97          }
98          return feeAmounts;
99      }
100 
101     public void setFeeAmounts(List<CurrencyAmountInfo> feeAmounts) {
102         this.feeAmounts = feeAmounts;
103     }
104 
105     @Override
106     public RichTextInfo getDescr() {
107         return descr;
108     }
109 
110     public void setDescr(RichTextInfo descr) {
111         this.descr = descr;
112     }
113 
114     @Override
115     public String getKey() {
116         return key;
117     }
118 
119     public void setId(String key) {
120         this.key = key;
121     }
122 }