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

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