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.r2.common.dto;
18  
19  import java.io.Serializable;
20  import java.util.List;
21  
22  import javax.xml.bind.annotation.XmlAccessType;
23  import javax.xml.bind.annotation.XmlAccessorType;
24  import javax.xml.bind.annotation.XmlAnyElement;
25  import javax.xml.bind.annotation.XmlAttribute;
26  import javax.xml.bind.annotation.XmlElement;
27  import javax.xml.bind.annotation.XmlType;
28  
29  import org.kuali.student.r2.common.infc.Locale;
30  //import org.w3c.dom.Element;
31  
32  
33  /**
34   * Information about Locale for Context.
35   *
36   * @author Sri komandur@uw.edu
37   */
38  
39  @XmlAccessorType(XmlAccessType.FIELD)
40  @XmlType(name = "LocaleInfo", propOrder = {
41                  "localeLanguage", "localeVariant",
42                  "localeRegion", "localeScript" , "_futureElements" }) 
43  
44  public class LocaleInfo 
45      implements Locale, Serializable {
46  
47      private static final long serialVersionUID = 1L;
48  
49      @XmlElement
50      private String localeLanguage;
51  
52      @XmlElement
53      private String localeVariant;
54  
55      @XmlElement
56      private String localeRegion;
57  
58      @XmlElement
59      private String localeScript;
60  
61      
62      @XmlAnyElement
63      private List<Object> _futureElements;
64  
65  
66      /**
67       * Constructs a new LocaleInfo.
68       */
69      public LocaleInfo() {
70      }
71  
72      /**
73       * Constructs a new LocaleInfo from another Locale.
74       *
75       * @param locale the locale to copy
76       */
77      public LocaleInfo(Locale locale) {
78          if (null != locale) {
79              this.localeLanguage = locale.getLocaleLanguage();
80              this.localeVariant = locale.getLocaleVariant();
81              this.localeRegion = locale.getLocaleRegion();
82              this.localeScript = locale.getLocaleScript();
83          }
84      }
85  
86      @Override
87      public String getLocaleLanguage() {
88          return this.localeLanguage;
89      }
90  
91      public void setLocaleLanguage(String localeLanguage) {
92          this.localeLanguage = localeLanguage;
93      }
94  
95      @Override
96      public String getLocaleVariant() {
97          return this.localeVariant;
98      }
99  
100     public void setLocaleVariant(String localeVariant) {
101         this.localeVariant = localeVariant;
102     }
103 
104     @Override
105     public String getLocaleRegion() {
106         return this.localeRegion;
107     }
108 
109     public void setLocaleRegion(String localeRegion) {
110         this.localeRegion = localeRegion;
111     }
112 
113     @Override
114     public String getLocaleScript() {
115         return this.localeScript;
116     }
117 
118     public void setLocaleScript(String localeScript) {
119         this.localeScript = localeScript;
120     }
121 }