View Javadoc
1   package org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.wrappers;
2   
3   import javax.xml.bind.annotation.XmlAccessType;
4   import javax.xml.bind.annotation.XmlAccessorType;
5   import javax.xml.bind.annotation.XmlElement;
6   import javax.xml.bind.annotation.XmlElementWrapper;
7   import javax.xml.bind.annotation.XmlRootElement;
8   import javax.xml.bind.annotation.XmlType;
9   import java.io.Serializable;
10  import java.util.ArrayList;
11  import java.util.List;
12  import java.util.SortedSet;
13  import java.util.TreeSet;
14  
15  /**
16   * Trivial transport object type for collections.
17   *
18   * @author <a href="mailto:lj@jguru.se">Lennart J&ouml;relid</a>, jGuru Europe AB
19   */
20  @XmlRootElement(namespace = "http://jaxb.mojohaus.org/wrappers")
21  @XmlType(namespace = "http://jaxb.mojohaus.org/wrappers", propOrder = {"strings", "integerSet"})
22  @XmlAccessorType(XmlAccessType.FIELD)
23  public class ExampleXmlWrapper implements Serializable {
24  
25      /**
26       * List containing some strings.
27       */
28      @XmlElementWrapper(name = "foobar")
29      @XmlElement(name = "aString")
30      private List<String> strings;
31  
32      /**
33       * SortedSet containing Integers.
34       */
35      @XmlElementWrapper
36      @XmlElement(name = "anInteger")
37      private SortedSet<Integer> integerSet;
38  
39  
40      public ExampleXmlWrapper() {
41  
42          this.strings = new ArrayList<String>();
43          this.integerSet = new TreeSet<Integer>();
44      }
45  
46      public List<String> getStrings() {
47          return strings;
48      }
49  
50      public SortedSet<Integer> getIntegerSet() {
51          return integerSet;
52      }
53  }