source: trunk/docx4j/src/main/java/org/docx4j/wml/CTSmartTagRun.java @ 1678

Revision 1678, 12.5 KB checked in by jharrop, 8 months ago (diff)

@XmlRootElement?(name = "smartTag")

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.XmlAttribute;
31import javax.xml.bind.annotation.XmlElementRef;
32import javax.xml.bind.annotation.XmlElementRefs;
33import javax.xml.bind.annotation.XmlRootElement;
34import javax.xml.bind.annotation.XmlTransient;
35import javax.xml.bind.annotation.XmlType;
36import org.docx4j.math.CTOMath;
37import org.docx4j.math.CTOMathPara;
38import org.jvnet.jaxb2_commons.ppp.Child;
39
40
41/**
42 * <p>Java class for CT_SmartTagRun complex type.
43 *
44 * <p>The following schema fragment specifies the expected content contained within this class.
45 *
46 * <pre>
47 * &lt;complexType name="CT_SmartTagRun">
48 *   &lt;complexContent>
49 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
50 *       &lt;sequence>
51 *         &lt;element name="smartTagPr" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_SmartTagPr" minOccurs="0"/>
52 *         &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_PContent" maxOccurs="unbounded" minOccurs="0"/>
53 *       &lt;/sequence>
54 *       &lt;attribute name="uri" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
55 *       &lt;attribute name="element" use="required" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
56 *     &lt;/restriction>
57 *   &lt;/complexContent>
58 * &lt;/complexType>
59 * </pre>
60 *
61 *
62 */
63@XmlAccessorType(XmlAccessType.FIELD)
64@XmlType(name = "CT_SmartTagRun", propOrder = {
65    "smartTagPr",
66    "paragraphContent"
67})
68@XmlRootElement(name = "smartTag")
69public class CTSmartTagRun
70    implements Child, ContentAccessor
71{
72
73    protected CTSmartTagPr smartTagPr;
74    @XmlElementRefs({
75        @XmlElementRef(name = "hyperlink", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
76        @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
77        @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
78        @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
79        @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class),
80        @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class),
81        @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
82        @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
83        @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
84        @XmlElementRef(name = "r", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = R.class),
85        @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
86        @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
87        @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
88        @XmlElementRef(name = "smartTag", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
89        @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class),
90        @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
91        @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
92        @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
93        @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class),
94        @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class),
95        @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
96        @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
97        @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
98        @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
99        @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
100        @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
101        @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
102        @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
103        @XmlElementRef(name = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
104        @XmlElementRef(name = "fldSimple", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
105        @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
106        @XmlElementRef(name = "subDoc", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class)
107    })
108    protected List<Object> paragraphContent;
109    @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
110    protected String uri;
111    @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", required = true)
112    protected String element;
113    @XmlTransient
114    private Object parent;
115
116    /**
117     * Gets the value of the smartTagPr property.
118     *
119     * @return
120     *     possible object is
121     *     {@link CTSmartTagPr }
122     *     
123     */
124    public CTSmartTagPr getSmartTagPr() {
125        return smartTagPr;
126    }
127
128    /**
129     * Sets the value of the smartTagPr property.
130     *
131     * @param value
132     *     allowed object is
133     *     {@link CTSmartTagPr }
134     *     
135     */
136    public void setSmartTagPr(CTSmartTagPr value) {
137        this.smartTagPr = value;
138    }
139
140    /**
141     * Gets the value of the paragraphContent property.
142     *
143     * <p>
144     * This accessor method returns a reference to the live list,
145     * not a snapshot. Therefore any modification you make to the
146     * returned list will be present inside the JAXB object.
147     * This is why there is not a <CODE>set</CODE> method for the paragraphContent property.
148     *
149     * <p>
150     * For example, to add a new item, do as follows:
151     * <pre>
152     *    getParagraphContent().add(newItem);
153     * </pre>
154     *
155     *
156     * <p>
157     * Objects of the following type(s) are allowed in the list
158     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.P.Hyperlink }{@code >}
159     * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
160     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
161     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
162     * {@link CommentRangeStart }
163     * {@link RunIns }
164     * {@link JAXBElement }{@code <}{@link CTPerm }{@code >}
165     * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >}
166     * {@link JAXBElement }{@code <}{@link CTOMath }{@code >}
167     * {@link R }
168     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
169     * {@link JAXBElement }{@code <}{@link SdtRun }{@code >}
170     * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
171     * {@link JAXBElement }{@code <}{@link CTSmartTagRun }{@code >}
172     * {@link CommentRangeEnd }
173     * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >}
174     * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
175     * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
176     * {@link ProofErr }
177     * {@link RunDel }
178     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
179     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
180     * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >}
181     * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
182     * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
183     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
184     * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
185     * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
186     * {@link JAXBElement }{@code <}{@link CTCustomXmlRun }{@code >}
187     * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
188     * {@link JAXBElement }{@code <}{@link CTSimpleField }{@code >}
189     * {@link JAXBElement }{@code <}{@link CTRel }{@code >}
190     *
191     *
192     */
193    @Deprecated
194    public List<Object> getParagraphContent() {
195        if (paragraphContent == null) {
196            paragraphContent = new ArrayList<Object>();
197        }
198        return this.paragraphContent;
199    }
200
201    /**
202     * Get the content of this element.
203     * @since 2.7
204     */   
205    public List<Object> getContent() {
206        if (paragraphContent == null) {
207            paragraphContent = new ArrayList<Object>();
208        }
209        return this.paragraphContent;
210    }
211   
212    /**
213     * Gets the value of the uri property.
214     *
215     * @return
216     *     possible object is
217     *     {@link String }
218     *     
219     */
220    public String getUri() {
221        return uri;
222    }
223
224    /**
225     * Sets the value of the uri property.
226     *
227     * @param value
228     *     allowed object is
229     *     {@link String }
230     *     
231     */
232    public void setUri(String value) {
233        this.uri = value;
234    }
235
236    /**
237     * Gets the value of the element property.
238     *
239     * @return
240     *     possible object is
241     *     {@link String }
242     *     
243     */
244    public String getElement() {
245        return element;
246    }
247
248    /**
249     * Sets the value of the element property.
250     *
251     * @param value
252     *     allowed object is
253     *     {@link String }
254     *     
255     */
256    public void setElement(String value) {
257        this.element = value;
258    }
259
260    /**
261     * Gets the parent object in the object tree representing the unmarshalled xml document.
262     *
263     * @return
264     *     The parent object.
265     */
266    public Object getParent() {
267        return this.parent;
268    }
269
270    public void setParent(Object parent) {
271        this.parent = parent;
272    }
273
274    /**
275     * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
276     *
277     * @param parent
278     *     The parent object in the object tree.
279     * @param unmarshaller
280     *     The unmarshaller that generated the instance.
281     */
282    public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
283        setParent(parent);
284    }
285
286}
Note: See TracBrowser for help on using the repository browser.