source: trunk/docx4j/src/main/java/org/docx4j/wml/CTSdtContentRun.java @ 1614

Revision 1614, 10.4 KB checked in by jharrop, 11 months ago (diff)

@XmlRootElement?(name = "sdtContent")

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.JAXBElement;
27import javax.xml.bind.Unmarshaller;
28import javax.xml.bind.annotation.XmlAccessType;
29import javax.xml.bind.annotation.XmlAccessorType;
30import javax.xml.bind.annotation.XmlElementRef;
31import javax.xml.bind.annotation.XmlElementRefs;
32import javax.xml.bind.annotation.XmlRootElement;
33import javax.xml.bind.annotation.XmlTransient;
34import javax.xml.bind.annotation.XmlType;
35import org.docx4j.math.CTOMath;
36import org.docx4j.math.CTOMathPara;
37import org.jvnet.jaxb2_commons.ppp.Child;
38
39
40/**
41 * <p>Java class for CT_SdtContentRun complex type.
42 *
43 * <p>The following schema fragment specifies the expected content contained within this class.
44 *
45 * <pre>
46 * &lt;complexType name="CT_SdtContentRun">
47 *   &lt;complexContent>
48 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
49 *       &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_PContent" maxOccurs="unbounded" minOccurs="0"/>
50 *     &lt;/restriction>
51 *   &lt;/complexContent>
52 * &lt;/complexType>
53 * </pre>
54 *
55 *
56 */
57@XmlAccessorType(XmlAccessType.FIELD)
58@XmlType(name = "CT_SdtContentRun", propOrder = {
59    "paragraphContent"
60})
61@XmlRootElement(name = "sdtContent")
62public class CTSdtContentRun
63    implements Child, ContentAccessor
64{
65
66    @XmlElementRefs({
67        @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class),
68        @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
69        @XmlElementRef(name = "subDoc", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
70        @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class),
71        @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
72        @XmlElementRef(name = "r", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = R.class),
73        @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
74        @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
75        @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
76        @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
77        @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
78        @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
79        @XmlElementRef(name = "hyperlink", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
80        @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class),
81        @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
82        @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
83        @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
84        @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class),
85        @XmlElementRef(name = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
86        @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class),
87        @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
88        @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
89        @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
90        @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
91        @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
92        @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
93        @XmlElementRef(name = "smartTag", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
94        @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
95        @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
96        @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
97        @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
98        @XmlElementRef(name = "fldSimple", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class)
99    })
100    protected List<Object> paragraphContent;
101    @XmlTransient
102    private Object parent;
103
104    /**
105     * Gets the value of the paragraphContent property.
106     *
107     * <p>
108     * This accessor method returns a reference to the live list,
109     * not a snapshot. Therefore any modification you make to the
110     * returned list will be present inside the JAXB object.
111     * This is why there is not a <CODE>set</CODE> method for the paragraphContent property.
112     *
113     * <p>
114     * For example, to add a new item, do as follows:
115     * <pre>
116     *    getParagraphContent().add(newItem);
117     * </pre>
118     *
119     *
120     * <p>
121     * Objects of the following type(s) are allowed in the list
122     * {@link CommentRangeStart }
123     * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
124     * {@link JAXBElement }{@code <}{@link CTRel }{@code >}
125     * {@link RunIns }
126     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
127     * {@link R }
128     * {@link JAXBElement }{@code <}{@link CTOMath }{@code >}
129     * {@link JAXBElement }{@code <}{@link SdtRun }{@code >}
130     * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
131     * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
132     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
133     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
134     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.P.Hyperlink }{@code >}
135     * {@link CommentRangeEnd }
136     * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
137     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
138     * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
139     * {@link ProofErr }
140     * {@link JAXBElement }{@code <}{@link CTCustomXmlRun }{@code >}
141     * {@link RunDel }
142     * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >}
143     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
144     * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >}
145     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
146     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
147     * {@link JAXBElement }{@code <}{@link CTPerm }{@code >}
148     * {@link JAXBElement }{@code <}{@link CTSmartTagRun }{@code >}
149     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
150     * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >}
151     * {@link JAXBElement }{@code <}{@link CTSimpleField }{@code >}
152     * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
153     * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
154     *
155     *
156     */
157    @Deprecated
158    public List<Object> getParagraphContent() {
159        if (paragraphContent == null) {
160            paragraphContent = new ArrayList<Object>();
161        }
162        return this.paragraphContent;
163    }
164
165    /**
166     * Get the content of this element.
167     * @since 2.7
168     */
169    public List<Object> getContent() {
170        if (paragraphContent == null) {
171            paragraphContent = new ArrayList<Object>();
172        }
173        return this.paragraphContent;
174    }
175   
176    /**
177     * Gets the parent object in the object tree representing the unmarshalled xml document.
178     *
179     * @return
180     *     The parent object.
181     */
182    public Object getParent() {
183        return this.parent;
184    }
185
186    public void setParent(Object parent) {
187        this.parent = parent;
188    }
189
190    /**
191     * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
192     *
193     * @param parent
194     *     The parent object in the object tree.
195     * @param unmarshaller
196     *     The unmarshaller that generated the instance.
197     */
198    public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
199        setParent(parent);
200    }
201
202}
Note: See TracBrowser for help on using the repository browser.