001    /**
002     * Copyright 2010 The Kuali Foundation 
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the
005     * "License"); you may not use this file except in compliance with the
006     * License. You may obtain a copy of the License at
007     *
008     * http://www.osedu.org/licenses/ECL-2.0
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
013     * implied. See the License for the specific language governing
014     * permissions and limitations under the License.
015     */
016    
017    package org.kuali.student.r2.common.dto;
018    
019    import java.io.Serializable;
020    import java.util.List;
021    
022    import javax.xml.bind.annotation.XmlAccessType;
023    import javax.xml.bind.annotation.XmlAccessorType;
024    import javax.xml.bind.annotation.XmlAnyElement;
025    import javax.xml.bind.annotation.XmlElement;
026    import javax.xml.bind.annotation.XmlType;
027    
028    import org.kuali.student.r2.common.infc.Attribute;
029    //import org.w3c.dom.Element;
030    
031    /**
032     * The DTO for an Attribute.
033     *
034     * @author Kuali Student Services team
035     */
036    
037    @XmlAccessorType(XmlAccessType.FIELD)
038    @XmlType(name = "AttributeInfo", propOrder = {
039                    "id", "key", "value" , "_futureElements" }) 
040    
041    public final class AttributeInfo 
042        implements Attribute, Serializable {
043    
044        private static final long serialVersionUID = 1L;
045        
046        @XmlElement
047        private String id;
048        
049        @XmlElement
050        private String key;
051        
052        @XmlElement
053        private String value;
054    
055        
056        @XmlAnyElement
057        private List<Object> _futureElements;
058    
059    
060        /**
061         * Constructs a new AttributeInfo.
062         */
063        public AttributeInfo() {
064        }
065    
066        /**
067         * Constructs a new AttributeInfo from another Attribute.
068         *
069         * @param attribute the attribute to copy
070         */
071        public AttributeInfo(Attribute attribute) {
072            if (attribute != null) {
073                this.id = attribute.getId();
074                this.key = attribute.getKey();
075                this.value = attribute.getValue();
076            }
077        }
078    
079        public AttributeInfo(String key, String value) {
080                    super();
081                    this.key = key;
082                    this.value = value;
083            }
084    
085            @Override
086        public String getId() {
087            return id;
088        }
089    
090        public void setId(String id) {
091            this.id = id;
092        }
093    
094        @Override
095        public String getKey() {
096            return key;
097        }
098        
099        public void setKey(String key) {
100            this.key = key;
101        }
102    
103        @Override
104        public String getValue() {
105            return value;
106        }
107        
108        public void setValue(String value) {
109            this.value = value;
110        }
111        
112    }