View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.rice.core.util.jaxb;
20  
21  import java.io.Serializable;
22  
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlAttribute;
26  import javax.xml.bind.annotation.XmlType;
27  import javax.xml.bind.annotation.XmlValue;
28  import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
29  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
30  
31  /**
32   * An XML element that stores a name and namespace pair in its simple content and "namespaceCode" attribute.
33   * 
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   */
36  @XmlAccessorType(XmlAccessType.FIELD)
37  @XmlType(name="NameAndNamespaceType")
38  public class NameAndNamespacePair implements Serializable {
39      
40      private static final long serialVersionUID = 1L;
41  
42      @XmlAttribute(name="namespaceCode", required=true)
43      @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
44      private String namespaceCode;
45      
46      @XmlValue
47      private String name;
48      
49      public NameAndNamespacePair() {}
50      
51      public NameAndNamespacePair(String namespaceCode, String name) {
52          this.namespaceCode = namespaceCode;
53          this.name = name;
54      }
55      
56      public String getNamespaceCode() {
57          return namespaceCode;
58      }
59  
60      public void setNamespaceCode(String namespaceCode) {
61          this.namespaceCode = namespaceCode;
62      }
63  
64      public String getName() {
65          return name;
66      }
67  
68      public void setName(String name) {
69          this.name = name;
70      }
71  
72  }