source: trunk/docx4j/src/main/java/org/docx4j/wml/CTCustomXmlCell.java @ 1438

Revision 1438, 11.7 KB checked in by jharrop, 15 months ago (diff)

Modifications to Richard's patch

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