001    /**
002     * Copyright 2005-2012 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.core.util.jaxb;
017    
018    import java.io.Serializable;
019    
020    import javax.xml.bind.annotation.XmlAccessType;
021    import javax.xml.bind.annotation.XmlAccessorType;
022    import javax.xml.bind.annotation.XmlAttribute;
023    import javax.xml.bind.annotation.XmlType;
024    import javax.xml.bind.annotation.XmlValue;
025    import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
026    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027    
028    /**
029     * An XML element that stores a name and namespace pair in its simple content and "namespaceCode" attribute.
030     * 
031     * @author Kuali Rice Team (rice.collab@kuali.org)
032     */
033    @XmlAccessorType(XmlAccessType.FIELD)
034    @XmlType(name="NameAndNamespaceType")
035    public class NameAndNamespacePair implements Serializable {
036        
037        private static final long serialVersionUID = 1L;
038    
039        @XmlAttribute(name="namespaceCode", required=true)
040        @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
041        private String namespaceCode;
042        
043        @XmlValue
044        private String name;
045        
046        public NameAndNamespacePair() {}
047        
048        public NameAndNamespacePair(String namespaceCode, String name) {
049            this.namespaceCode = namespaceCode;
050            this.name = name;
051        }
052        
053        public String getNamespaceCode() {
054            return namespaceCode;
055        }
056    
057        public void setNamespaceCode(String namespaceCode) {
058            this.namespaceCode = namespaceCode;
059        }
060    
061        public String getName() {
062            return name;
063        }
064    
065        public void setName(String name) {
066            this.name = name;
067        }
068    
069    }