View Javadoc

1   /**
2    * Copyright 2005-2014 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/ecl2.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.api.mo;
17  
18  import org.kuali.rice.core.api.CoreConstants;
19  import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
20  import org.w3c.dom.Element;
21  
22  import javax.xml.bind.annotation.XmlAccessType;
23  import javax.xml.bind.annotation.XmlAccessorType;
24  import javax.xml.bind.annotation.XmlAnyElement;
25  import javax.xml.bind.annotation.XmlElement;
26  import javax.xml.bind.annotation.XmlElementWrapper;
27  import javax.xml.bind.annotation.XmlNsForm;
28  import javax.xml.bind.annotation.XmlRootElement;
29  import javax.xml.bind.annotation.XmlSchema;
30  import javax.xml.bind.annotation.XmlType;
31  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
32  import java.util.Collection;
33  import java.util.List;
34  import java.util.Map;
35  
36  /**
37   * A sample {@code AbstractDataTransferObject} use in tests.
38   *
39   * @author Kuali Rice Team (rice.collab@kuali.org)
40   */
41  @XmlRootElement(name = "sampleDataTransferObject", namespace = CoreConstants.Namespaces.CORE_NAMESPACE_2_0)
42  @XmlAccessorType(XmlAccessType.NONE)
43  @XmlType(name = "SampleDataTransferObjectType", namespace = CoreConstants.Namespaces.CORE_NAMESPACE_2_0, propOrder = {
44          "name", "values", "attributes", CoreConstants.CommonElements.FUTURE_ELEMENTS
45  })
46  public class SampleDataTransferObject extends AbstractDataTransferObject {
47  
48      @XmlElement(name = "name", required = false)
49      private final String name;
50  
51      @XmlElementWrapper(name = "values", required = false)
52      @XmlElement(name = "value", required = false)
53      private final List<String> values;
54  
55      @XmlElement(name = "attributes", required = false)
56      @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
57      private final Map<String, String> attributes;
58  
59      @SuppressWarnings("unused")
60      @XmlAnyElement
61      private final Collection<Element> _futureElements = null;
62  
63      /**
64       * This constructor should never be called.
65       * It is only present for use during JAXB unmarshalling.
66       */
67      private SampleDataTransferObject() {
68      	this.name = null;
69          this.values = null;
70          this.attributes = null;
71      }
72  
73      public SampleDataTransferObject(String name, List<String> values, Map<String, String> attributes) {
74          this.name = name;
75          this.values = values;
76          this.attributes = attributes;
77      }
78  
79      public String getName() {
80          return name;
81      }
82  
83      public List<String> getValues() {
84          return values;
85      }
86  
87      public Map<String, String> getAttributes() {
88          return attributes;
89      }
90      
91  }