View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.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/ecl2.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.rice.core.util.jaxb;
17  
18  import java.io.Serializable;
19  
20  import javax.xml.bind.annotation.XmlAccessType;
21  import javax.xml.bind.annotation.XmlAccessorType;
22  import javax.xml.bind.annotation.XmlAttribute;
23  import javax.xml.bind.annotation.XmlType;
24  import javax.xml.bind.annotation.XmlValue;
25  import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
26  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
27  
28  /**
29   * An XML element that stores a name and namespace pair in its simple content and "namespaceCode" attribute.
30   * 
31   * @author Kuali Rice Team (rice.collab@kuali.org)
32   */
33  @XmlAccessorType(XmlAccessType.FIELD)
34  @XmlType(name="NameAndNamespaceType")
35  public class NameAndNamespacePair implements Serializable {
36      
37      private static final long serialVersionUID = 1L;
38  
39      @XmlAttribute(name="namespaceCode", required=true)
40      @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
41      private String namespaceCode;
42      
43      @XmlValue
44      private String name;
45      
46      public NameAndNamespacePair() {}
47      
48      public NameAndNamespacePair(String namespaceCode, String name) {
49          this.namespaceCode = namespaceCode;
50          this.name = name;
51      }
52      
53      public String getNamespaceCode() {
54          return namespaceCode;
55      }
56  
57      public void setNamespaceCode(String namespaceCode) {
58          this.namespaceCode = namespaceCode;
59      }
60  
61      public String getName() {
62          return name;
63      }
64  
65      public void setName(String name) {
66          this.name = name;
67      }
68  
69  }