source: trunk/docx4j/src/main/java/org/docx4j/math/CTR.java @ 940

Revision 940, 12.6 KB checked in by jharrop, 3 years ago (diff)

Fix all 11 instances of "Two classes have the same XML type name .. Use .. @XmlType?.namespace to assign different names to them."

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.math;
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.XmlTransient;
33import javax.xml.bind.annotation.XmlType;
34import javax.xml.namespace.QName;
35import org.docx4j.wml.Br;
36import org.docx4j.wml.CTFtnEdnRef;
37import org.docx4j.wml.CTObject;
38import org.docx4j.wml.CTRuby;
39import org.docx4j.wml.DelText;
40import org.docx4j.wml.Drawing;
41import org.docx4j.wml.FldChar;
42import org.docx4j.wml.Pict;
43import org.docx4j.wml.RPr;
44import org.docx4j.wml.Text;
45import org.jvnet.jaxb2_commons.ppp.Child;
46
47
48/**
49 * <p>Java class for CT_R complex type.
50 *
51 * <p>The following schema fragment specifies the expected content contained within this class.
52 *
53 * <pre>
54 * &lt;complexType name="CT_R">
55 *   &lt;complexContent>
56 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
57 *       &lt;sequence>
58 *         &lt;element name="rPr" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_RPR" minOccurs="0"/>
59 *         &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_RPr" minOccurs="0"/>
60 *         &lt;choice maxOccurs="unbounded" minOccurs="0">
61 *           &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_RunInnerContent"/>
62 *           &lt;element name="t" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_Text" minOccurs="0"/>
63 *         &lt;/choice>
64 *       &lt;/sequence>
65 *     &lt;/restriction>
66 *   &lt;/complexContent>
67 * &lt;/complexType>
68 * </pre>
69 *
70 *
71 */
72@XmlAccessorType(XmlAccessType.FIELD)
73@XmlType(namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", 
74                 name = "CT_R", propOrder = {
75    "content"
76})
77public class CTR
78    implements Child
79{
80
81    @XmlElementRefs({
82        @XmlElementRef(name = "monthShort", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
83        @XmlElementRef(name = "ptab", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
84        @XmlElementRef(name = "ruby", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
85        @XmlElementRef(name = "sym", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
86        @XmlElementRef(name = "drawing", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
87        @XmlElementRef(name = "yearShort", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
88        @XmlElementRef(name = "continuationSeparator", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
89        @XmlElementRef(name = "fldChar", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
90        @XmlElementRef(name = "instrText", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
91        @XmlElementRef(name = "rPr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
92        @XmlElementRef(name = "t", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
93        @XmlElementRef(name = "footnoteReference", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
94        @XmlElementRef(name = "dayShort", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
95        @XmlElementRef(name = "commentReference", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
96        @XmlElementRef(name = "noBreakHyphen", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
97        @XmlElementRef(name = "monthLong", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
98        @XmlElementRef(name = "tab", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
99        @XmlElementRef(name = "br", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = Br.class),
100        @XmlElementRef(name = "softHyphen", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
101        @XmlElementRef(name = "pgNum", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
102        @XmlElementRef(name = "lastRenderedPageBreak", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
103        @XmlElementRef(name = "endnoteReference", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
104        @XmlElementRef(name = "endnoteRef", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
105        @XmlElementRef(name = "separator", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
106        @XmlElementRef(name = "pict", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
107        @XmlElementRef(name = "cr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
108        @XmlElementRef(name = "dayLong", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
109        @XmlElementRef(name = "delText", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = DelText.class),
110        @XmlElementRef(name = "delInstrText", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
111        @XmlElementRef(name = "t", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = CTR.TMath.class),
112        @XmlElementRef(name = "yearLong", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
113        @XmlElementRef(name = "rPr", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = CTR.RPrMath.class),
114        @XmlElementRef(name = "annotationRef", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
115        @XmlElementRef(name = "object", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
116        @XmlElementRef(name = "footnoteRef", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class)
117    })
118    protected List<Object> content;
119    @XmlTransient
120    private Object parent;
121
122    /**
123     * Gets the rest of the content model.
124     *
125     * <p>
126     * You are getting this "catch-all" property because of the following reason:
127     * The field name "RPr" is used by two different parts of a schema. See:
128     * line 7165 of file:/home/dev/workspace/docx4j/xsd/wml/wml.xsd
129     * line 480 of file:/home/dev/workspace/docx4j/xsd/shared/shared-math.xsd
130     * <p>
131     * To get rid of this property, apply a property customization to one
132     * of both of the following declarations to change their names:
133     * Gets the value of the content property.
134     *
135     * <p>
136     * This accessor method returns a reference to the live list,
137     * not a snapshot. Therefore any modification you make to the
138     * returned list will be present inside the JAXB object.
139     * This is why there is not a <CODE>set</CODE> method for the content property.
140     *
141     * <p>
142     * For example, to add a new item, do as follows:
143     * <pre>
144     *    getContent().add(newItem);
145     * </pre>
146     *
147     *
148     * <p>
149     * Objects of the following type(s) are allowed in the list
150     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.MonthShort }{@code >}
151     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.Ptab }{@code >}
152     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.Sym }{@code >}
153     * {@link JAXBElement }{@code <}{@link CTRuby }{@code >}
154     * {@link JAXBElement }{@code <}{@link Drawing }{@code >}
155     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.YearShort }{@code >}
156     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.ContinuationSeparator }{@code >}
157     * {@link JAXBElement }{@code <}{@link FldChar }{@code >}
158     * {@link JAXBElement }{@code <}{@link Text }{@code >}
159     * {@link JAXBElement }{@code <}{@link RPr }{@code >}
160     * {@link JAXBElement }{@code <}{@link Text }{@code >}
161     * {@link JAXBElement }{@code <}{@link CTFtnEdnRef }{@code >}
162     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.CommentReference }{@code >}
163     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.DayShort }{@code >}
164     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.NoBreakHyphen }{@code >}
165     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.MonthLong }{@code >}
166     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.Tab }{@code >}
167     * {@link Br }
168     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.SoftHyphen }{@code >}
169     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.LastRenderedPageBreak }{@code >}
170     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.PgNum }{@code >}
171     * {@link JAXBElement }{@code <}{@link CTFtnEdnRef }{@code >}
172     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.Separator }{@code >}
173     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.EndnoteRef }{@code >}
174     * {@link JAXBElement }{@code <}{@link Pict }{@code >}
175     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.Cr }{@code >}
176     * {@link DelText }
177     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.DayLong }{@code >}
178     * {@link JAXBElement }{@code <}{@link Text }{@code >}
179     * {@link CTR.TMath }
180     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.YearLong }{@code >}
181     * {@link JAXBElement }{@code <}{@link CTObject }{@code >}
182     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.AnnotationRef }{@code >}
183     * {@link CTR.RPrMath }
184     * {@link JAXBElement }{@code <}{@link org.docx4j.wml.R.FootnoteRef }{@code >}
185     *
186     *
187     */
188    public List<Object> getContent() {
189        if (content == null) {
190            content = new ArrayList<Object>();
191        }
192        return this.content;
193    }
194
195    /**
196     * Gets the parent object in the object tree representing the unmarshalled xml document.
197     *
198     * @return
199     *     The parent object.
200     */
201    public Object getParent() {
202        return this.parent;
203    }
204
205    public void setParent(Object parent) {
206        this.parent = parent;
207    }
208
209    /**
210     * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
211     *
212     * @param parent
213     *     The parent object in the object tree.
214     * @param unmarshaller
215     *     The unmarshaller that generated the instance.
216     */
217    public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
218        setParent(parent);
219    }
220
221    public static class RPrMath
222        extends JAXBElement<CTRPR>
223    {
224
225        protected final static QName NAME = new QName("http://schemas.openxmlformats.org/officeDocument/2006/math", "rPr");
226
227        public RPrMath(CTRPR value) {
228            super(NAME, ((Class) CTRPR.class), CTR.class, value);
229        }
230
231    }
232
233    public static class TMath
234        extends JAXBElement<CTText>
235    {
236
237        protected final static QName NAME = new QName("http://schemas.openxmlformats.org/officeDocument/2006/math", "t");
238
239        public TMath(CTText value) {
240            super(NAME, ((Class) CTText.class), CTR.class, value);
241        }
242
243    }
244
245}
Note: See TracBrowser for help on using the repository browser.