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.kim.api.jaxb;
017    
018    import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
019    
020    import javax.xml.bind.annotation.XmlAccessType;
021    import javax.xml.bind.annotation.XmlAccessorType;
022    import javax.xml.bind.annotation.XmlElement;
023    import javax.xml.bind.annotation.XmlType;
024    import java.io.Serializable;
025    import java.util.ArrayList;
026    import java.util.List;
027    import java.util.Map;
028    
029    /**
030     * An XML element that can have zero or more StringMapEntry elements. This is similar
031     * to the StringMapEntryList, except this element's children are <permissionDetail> elements.
032     * 
033     * @author Kuali Rice Team (rice.collab@kuali.org)
034     */
035    @XmlAccessorType(XmlAccessType.FIELD)
036    @XmlType(name="PermissionDetailListType", propOrder={"permissionDetails"})
037    public class PermissionDetailList implements Serializable {
038    
039        private static final long serialVersionUID = 1L;
040        
041        @XmlElement(name="permissionDetail")
042        private List<MapStringStringAdapter.StringMapEntry> permissionDetails;
043        
044        public PermissionDetailList() {
045            this.permissionDetails = new ArrayList<MapStringStringAdapter.StringMapEntry>();
046        }
047        
048        public PermissionDetailList(Map<String, String> map) {
049            this();
050            for (Map.Entry<String,String> tempEntry : map.entrySet()) {
051                permissionDetails.add(new MapStringStringAdapter.StringMapEntry(tempEntry));
052            }
053        }
054    
055        /**
056         * @return the permissionDetails
057         */
058        public List<MapStringStringAdapter.StringMapEntry> getPermissionDetails() {
059            return this.permissionDetails;
060        }
061    
062        /**
063         * @param permissionDetails the permissionDetails to set
064         */
065        public void setPermissionDetails(List<MapStringStringAdapter.StringMapEntry> permissionDetails) {
066            this.permissionDetails = permissionDetails;
067        }
068        
069    }