View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.rice.core.impl.jaxb;
20  
21  import java.util.List;
22  
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlAnyElement;
26  import javax.xml.bind.annotation.XmlElement;
27  import javax.xml.bind.annotation.XmlRootElement;
28  import javax.xml.bind.annotation.XmlType;
29  
30  import org.kuali.rice.core.api.CoreConstants;
31  import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
32  import org.kuali.rice.core.util.jaxb.RiceXmlListAdditionListener;
33  import org.kuali.rice.kim.impl.jaxb.PermissionDataXmlDTO;
34  import org.kuali.rice.kim.impl.jaxb.RoleDataXmlDTO;
35  import org.w3c.dom.Element;
36  
37  /**
38   * This class represents the root &lt;data&gt; XML element.
39   * 
40   * <p>Please see the Javadocs for PermissionDataXmlDTO and RoleDataXmlDTO for more information
41   * on their expected structure.
42   * 
43   * @author Kuali Rice Team (rice.collab@kuali.org)
44   */
45  @XmlRootElement(name="data")
46  @XmlAccessorType(XmlAccessType.FIELD)
47  @XmlType(name="DataType", propOrder={"permissionData", "roleData", CoreConstants.CommonElements.FUTURE_ELEMENTS})
48  public class DataXmlDTO  extends AbstractDataTransferObject implements RiceXmlListAdditionListener<Element> {
49  
50      private static final long serialVersionUID = 1L;
51      
52      @XmlElement(name="permissionData")
53      private PermissionDataXmlDTO permissionData;
54      
55      @XmlElement(name="roleData")
56      private RoleDataXmlDTO roleData;
57      
58      @XmlAnyElement
59      private final List<Element> _futureElements = null;
60      
61      public DataXmlDTO() {}
62      
63      public DataXmlDTO(PermissionDataXmlDTO permissionData, RoleDataXmlDTO roleData) {
64          this.permissionData = permissionData;
65          this.roleData = roleData;
66      }
67  
68      /**
69       * @return the permissionData
70       */
71      public PermissionDataXmlDTO getPermissionData() {
72          return this.permissionData;
73      }
74  
75      /**
76       * @param permissionData the permissionData to set
77       */
78      public void setPermissionData(PermissionDataXmlDTO permissionData) {
79          this.permissionData = permissionData;
80      }
81  
82      /**
83       * @return the roleData
84       */
85      public RoleDataXmlDTO getRoleData() {
86          return this.roleData;
87      }
88  
89      /**
90       * @param roleData the roleData to set
91       */
92      public void setRoleData(RoleDataXmlDTO roleData) {
93          this.roleData = roleData;
94      }
95  
96      /**
97       * @see org.kuali.rice.core.util.jaxb.RiceXmlListAdditionListener#newItemAdded(java.lang.Object)
98       */
99      @Override
100     public void newItemAdded(Element item) {
101         // Do nothing; this class just implements the streaming unmarshalling listener so that it doesn't hold onto all the DOM elements.
102     }
103 }