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.impl.jaxb;
017
018import java.util.List;
019
020import javax.xml.bind.annotation.XmlAccessType;
021import javax.xml.bind.annotation.XmlAccessorType;
022import javax.xml.bind.annotation.XmlAnyElement;
023import javax.xml.bind.annotation.XmlElement;
024import javax.xml.bind.annotation.XmlRootElement;
025import javax.xml.bind.annotation.XmlType;
026
027import org.kuali.rice.core.api.CoreConstants;
028import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
029import org.kuali.rice.core.util.jaxb.RiceXmlListAdditionListener;
030import org.kuali.rice.kim.impl.jaxb.PermissionDataXmlDTO;
031import org.kuali.rice.kim.impl.jaxb.RoleDataXmlDTO;
032import org.w3c.dom.Element;
033
034/**
035 * This class represents the root <data> XML element.
036 * 
037 * <p>Please see the Javadocs for PermissionDataXmlDTO and RoleDataXmlDTO for more information
038 * on their expected structure.
039 * 
040 * @author Kuali Rice Team (rice.collab@kuali.org)
041 */
042@XmlRootElement(name="data")
043@XmlAccessorType(XmlAccessType.FIELD)
044@XmlType(name="DataType", propOrder={"permissionData", "roleData", CoreConstants.CommonElements.FUTURE_ELEMENTS})
045public class DataXmlDTO  extends AbstractDataTransferObject implements RiceXmlListAdditionListener<Element> {
046
047    private static final long serialVersionUID = 1L;
048    
049    @XmlElement(name="permissionData")
050    private PermissionDataXmlDTO permissionData;
051    
052    @XmlElement(name="roleData")
053    private RoleDataXmlDTO roleData;
054    
055    @XmlAnyElement
056    private final List<Element> _futureElements = null;
057    
058    public DataXmlDTO() {}
059    
060    public DataXmlDTO(PermissionDataXmlDTO permissionData, RoleDataXmlDTO roleData) {
061        this.permissionData = permissionData;
062        this.roleData = roleData;
063    }
064
065    /**
066     * @return the permissionData
067     */
068    public PermissionDataXmlDTO getPermissionData() {
069        return this.permissionData;
070    }
071
072    /**
073     * @param permissionData the permissionData to set
074     */
075    public void setPermissionData(PermissionDataXmlDTO permissionData) {
076        this.permissionData = permissionData;
077    }
078
079    /**
080     * @return the roleData
081     */
082    public RoleDataXmlDTO getRoleData() {
083        return this.roleData;
084    }
085
086    /**
087     * @param roleData the roleData to set
088     */
089    public void setRoleData(RoleDataXmlDTO roleData) {
090        this.roleData = roleData;
091    }
092
093    /**
094     * @see org.kuali.rice.core.util.jaxb.RiceXmlListAdditionListener#newItemAdded(java.lang.Object)
095     */
096    @Override
097    public void newItemAdded(Element item) {
098        // Do nothing; this class just implements the streaming unmarshalling listener so that it doesn't hold onto all the DOM elements.
099    }
100}