source: trunk/docx4j/src/main/java/org/docx4j/wml/Tabs.java @ 844

Revision 844, 3.4 KB checked in by jharrop, 3 years ago (diff)

Add @XmlRootElement?(name = "tabs")

Line 
1/*
2 *  Copyright 2007-2008, Plutext Pty Ltd.
3 *   
4 *  This file is part of docx4j.
5
6    docx4j is licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8
9    You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13    Unless required by applicable law or agreed to in writing, software
14    distributed under the License is distributed on an "AS IS" BASIS,
15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16    See the License for the specific language governing permissions and
17    limitations under the License.
18
19 */
20
21
22package org.docx4j.wml;
23
24import java.util.ArrayList;
25import java.util.List;
26import javax.xml.bind.Unmarshaller;
27import javax.xml.bind.annotation.XmlAccessType;
28import javax.xml.bind.annotation.XmlAccessorType;
29import javax.xml.bind.annotation.XmlElement;
30import javax.xml.bind.annotation.XmlRootElement;
31import javax.xml.bind.annotation.XmlTransient;
32import javax.xml.bind.annotation.XmlType;
33import org.jvnet.jaxb2_commons.ppp.Child;
34
35
36/**
37 * <p>Java class for CT_Tabs complex type.
38 *
39 * <p>The following schema fragment specifies the expected content contained within this class.
40 *
41 * <pre>
42 * &lt;complexType name="CT_Tabs">
43 *   &lt;complexContent>
44 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
45 *       &lt;sequence>
46 *         &lt;element name="tab" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TabStop" maxOccurs="unbounded"/>
47 *       &lt;/sequence>
48 *     &lt;/restriction>
49 *   &lt;/complexContent>
50 * &lt;/complexType>
51 * </pre>
52 *
53 *
54 */
55@XmlAccessorType(XmlAccessType.FIELD)
56@XmlType(name = "CT_Tabs", propOrder = {
57    "tab"
58})
59@XmlRootElement(name = "tabs")
60public class Tabs
61    implements Child
62{
63
64    @XmlElement(required = true)
65    protected List<CTTabStop> tab;
66    @XmlTransient
67    private Object parent;
68
69    /**
70     * Gets the value of the tab property.
71     *
72     * <p>
73     * This accessor method returns a reference to the live list,
74     * not a snapshot. Therefore any modification you make to the
75     * returned list will be present inside the JAXB object.
76     * This is why there is not a <CODE>set</CODE> method for the tab property.
77     *
78     * <p>
79     * For example, to add a new item, do as follows:
80     * <pre>
81     *    getTab().add(newItem);
82     * </pre>
83     *
84     *
85     * <p>
86     * Objects of the following type(s) are allowed in the list
87     * {@link CTTabStop }
88     *
89     *
90     */
91    public List<CTTabStop> getTab() {
92        if (tab == null) {
93            tab = new ArrayList<CTTabStop>();
94        }
95        return this.tab;
96    }
97
98    /**
99     * Gets the parent object in the object tree representing the unmarshalled xml document.
100     *
101     * @return
102     *     The parent object.
103     */
104    public Object getParent() {
105        return this.parent;
106    }
107
108    public void setParent(Object parent) {
109        this.parent = parent;
110    }
111
112    /**
113     * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
114     *
115     * @param parent
116     *     The parent object in the object tree.
117     * @param unmarshaller
118     *     The unmarshaller that generated the instance.
119     */
120    public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
121        setParent(parent);
122    }
123
124}
Note: See TracBrowser for help on using the repository browser.