source: trunk/docx4j/src/main/java/org/docx4j/wml/CTAltChunk.java @ 955

Revision 955, 3.7 KB checked in by jharrop, 3 years ago (diff)

Make altChunk work; add sample code.

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 javax.xml.bind.Unmarshaller;
25import javax.xml.bind.annotation.XmlAccessType;
26import javax.xml.bind.annotation.XmlAccessorType;
27import javax.xml.bind.annotation.XmlAttribute;
28import javax.xml.bind.annotation.XmlRootElement;
29import javax.xml.bind.annotation.XmlTransient;
30import javax.xml.bind.annotation.XmlType;
31import org.jvnet.jaxb2_commons.ppp.Child;
32
33
34/**
35 * <p>Java class for CT_AltChunk complex type.
36 *
37 * <p>The following schema fragment specifies the expected content contained within this class.
38 *
39 * <pre>
40 * &lt;complexType name="CT_AltChunk">
41 *   &lt;complexContent>
42 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
43 *       &lt;sequence>
44 *         &lt;element name="altChunkPr" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_AltChunkPr" minOccurs="0"/>
45 *       &lt;/sequence>
46 *       &lt;attribute ref="{http://schemas.openxmlformats.org/officeDocument/2006/relationships}id"/>
47 *     &lt;/restriction>
48 *   &lt;/complexContent>
49 * &lt;/complexType>
50 * </pre>
51 *
52 *
53 */
54@XmlAccessorType(XmlAccessType.FIELD)
55@XmlType(name = "CT_AltChunk", propOrder = {
56    "altChunkPr"
57})
58@XmlRootElement(name = "altChunk")
59public class CTAltChunk
60    implements Child
61{
62
63    protected CTAltChunkPr altChunkPr;
64    @XmlAttribute(namespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships")
65    protected String id;
66    @XmlTransient
67    private Object parent;
68
69    /**
70     * Gets the value of the altChunkPr property.
71     *
72     * @return
73     *     possible object is
74     *     {@link CTAltChunkPr }
75     *     
76     */
77    public CTAltChunkPr getAltChunkPr() {
78        return altChunkPr;
79    }
80
81    /**
82     * Sets the value of the altChunkPr property.
83     *
84     * @param value
85     *     allowed object is
86     *     {@link CTAltChunkPr }
87     *     
88     */
89    public void setAltChunkPr(CTAltChunkPr value) {
90        this.altChunkPr = value;
91    }
92
93    /**
94     * Relationship to Part
95     *
96     * @return
97     *     possible object is
98     *     {@link String }
99     *     
100     */
101    public String getId() {
102        return id;
103    }
104
105    /**
106     * Sets the value of the id property.
107     *
108     * @param value
109     *     allowed object is
110     *     {@link String }
111     *     
112     */
113    public void setId(String value) {
114        this.id = value;
115    }
116
117    /**
118     * Gets the parent object in the object tree representing the unmarshalled xml document.
119     *
120     * @return
121     *     The parent object.
122     */
123    public Object getParent() {
124        return this.parent;
125    }
126
127    public void setParent(Object parent) {
128        this.parent = parent;
129    }
130
131    /**
132     * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
133     *
134     * @param parent
135     *     The parent object in the object tree.
136     * @param unmarshaller
137     *     The unmarshaller that generated the instance.
138     */
139    public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
140        setParent(parent);
141    }
142
143}
Note: See TracBrowser for help on using the repository browser.