View Javadoc
1   /*
2    * Copyright 2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.core.impl.jaxb;
17  
18  import java.util.List;
19  
20  import javax.xml.bind.annotation.XmlAccessType;
21  import javax.xml.bind.annotation.XmlAccessorType;
22  import javax.xml.bind.annotation.XmlAnyElement;
23  import javax.xml.bind.annotation.XmlElement;
24  import javax.xml.bind.annotation.XmlRootElement;
25  import javax.xml.bind.annotation.XmlType;
26  
27  import org.kuali.rice.core.api.CoreConstants;
28  import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
29  import org.kuali.rice.core.util.jaxb.RiceXmlListAdditionListener;
30  import org.kuali.rice.kim.impl.jaxb.PermissionDataXmlDTO;
31  import org.kuali.rice.kim.impl.jaxb.RoleDataXmlDTO;
32  import org.w3c.dom.Element;
33  
34  /**
35   * This class represents the root <data> XML element.
36   * 
37   * <p>Please see the Javadocs for PermissionDataXmlDTO and RoleDataXmlDTO for more information
38   * on their expected structure.
39   * 
40   * @author Kuali Rice Team (rice.collab@kuali.org)
41   */
42  @XmlRootElement(name="data")
43  @XmlAccessorType(XmlAccessType.FIELD)
44  @XmlType(name="DataType", propOrder={"permissionData", "roleData", CoreConstants.CommonElements.FUTURE_ELEMENTS})
45  public class DataXmlDTO  extends AbstractDataTransferObject implements RiceXmlListAdditionListener<Element> {
46  
47      private static final long serialVersionUID = 1L;
48      
49      @XmlElement(name="permissionData")
50      private PermissionDataXmlDTO permissionData;
51      
52      @XmlElement(name="roleData")
53      private RoleDataXmlDTO roleData;
54      
55      @XmlAnyElement
56      private final List<Element> _futureElements = null;
57      
58      public DataXmlDTO() {}
59      
60      public DataXmlDTO(PermissionDataXmlDTO permissionData, RoleDataXmlDTO roleData) {
61          this.permissionData = permissionData;
62          this.roleData = roleData;
63      }
64  
65      /**
66       * @return the permissionData
67       */
68      public PermissionDataXmlDTO getPermissionData() {
69          return this.permissionData;
70      }
71  
72      /**
73       * @param permissionData the permissionData to set
74       */
75      public void setPermissionData(PermissionDataXmlDTO permissionData) {
76          this.permissionData = permissionData;
77      }
78  
79      /**
80       * @return the roleData
81       */
82      public RoleDataXmlDTO getRoleData() {
83          return this.roleData;
84      }
85  
86      /**
87       * @param roleData the roleData to set
88       */
89      public void setRoleData(RoleDataXmlDTO roleData) {
90          this.roleData = roleData;
91      }
92  
93      /**
94       * @see org.kuali.rice.core.util.jaxb.RiceXmlListAdditionListener#newItemAdded(java.lang.Object)
95       */
96      @Override
97      public void newItemAdded(Element item) {
98          // Do nothing; this class just implements the streaming unmarshalling listener so that it doesn't hold onto all the DOM elements.
99      }
100 }