001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.core.util.jaxb;
017
018import java.io.Serializable;
019
020import javax.xml.bind.annotation.XmlAccessType;
021import javax.xml.bind.annotation.XmlAccessorType;
022import javax.xml.bind.annotation.XmlAttribute;
023import javax.xml.bind.annotation.XmlType;
024import javax.xml.bind.annotation.XmlValue;
025import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
026import 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")
035public 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}