source: trunk/docx4j/src/main/java/org/docx4j/wml/CTCompatSetting.java @ 1741

Revision 1741, 4.5 KB checked in by jharrop, 5 months ago (diff)

Add element name="compatSetting" and type="CT_CompatSetting" from ECMA-376 2ed to wml, so Word 2010 can detect docx as native

Line 
1/*
2 *  Copyright 2012, 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
21package org.docx4j.wml;
22
23import javax.xml.bind.Unmarshaller;
24import javax.xml.bind.annotation.XmlAccessType;
25import javax.xml.bind.annotation.XmlAccessorType;
26import javax.xml.bind.annotation.XmlAttribute;
27import javax.xml.bind.annotation.XmlTransient;
28import javax.xml.bind.annotation.XmlType;
29import org.jvnet.jaxb2_commons.ppp.Child;
30
31
32/**
33 * <p>Java class for CT_CompatSetting complex type.
34 *
35 * <p>The following schema fragment specifies the expected content contained within this class.
36 *
37 * <pre>
38 * &lt;complexType name="CT_CompatSetting">
39 *   &lt;complexContent>
40 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
41 *       &lt;attribute name="name" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
42 *       &lt;attribute name="uri" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
43 *       &lt;attribute name="val" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
44 *     &lt;/restriction>
45 *   &lt;/complexContent>
46 * &lt;/complexType>
47 * </pre>
48 *
49 *
50 */
51@XmlAccessorType(XmlAccessType.FIELD)
52@XmlType(namespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main", name = "CT_CompatSetting")
53public class CTCompatSetting
54    implements Child
55{
56
57    @XmlAttribute(name = "name", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
58    protected String name;
59    @XmlAttribute(name = "uri", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
60    protected String uri;
61    @XmlAttribute(name = "val", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
62    protected String val;
63    @XmlTransient
64    private Object parent;
65
66    /**
67     * Gets the value of the name property.
68     *
69     * @return
70     *     possible object is
71     *     {@link String }
72     *     
73     */
74    public String getName() {
75        return name;
76    }
77
78    /**
79     * Sets the value of the name property.
80     *
81     * @param value
82     *     allowed object is
83     *     {@link String }
84     *     
85     */
86    public void setName(String value) {
87        this.name = value;
88    }
89
90    /**
91     * Gets the value of the uri property.
92     *
93     * @return
94     *     possible object is
95     *     {@link String }
96     *     
97     */
98    public String getUri() {
99        return uri;
100    }
101
102    /**
103     * Sets the value of the uri property.
104     *
105     * @param value
106     *     allowed object is
107     *     {@link String }
108     *     
109     */
110    public void setUri(String value) {
111        this.uri = value;
112    }
113
114    /**
115     * Gets the value of the val property.
116     *
117     * @return
118     *     possible object is
119     *     {@link String }
120     *     
121     */
122    public String getVal() {
123        return val;
124    }
125
126    /**
127     * Sets the value of the val property.
128     *
129     * @param value
130     *     allowed object is
131     *     {@link String }
132     *     
133     */
134    public void setVal(String value) {
135        this.val = value;
136    }
137
138    /**
139     * Gets the parent object in the object tree representing the unmarshalled xml document.
140     *
141     * @return
142     *     The parent object.
143     */
144    public Object getParent() {
145        return this.parent;
146    }
147
148    public void setParent(Object parent) {
149        this.parent = parent;
150    }
151
152    /**
153     * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
154     *
155     * @param parent
156     *     The parent object in the object tree.
157     * @param unmarshaller
158     *     The unmarshaller that generated the instance.
159     */
160    public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
161        setParent(parent);
162    }
163
164}
Note: See TracBrowser for help on using the repository browser.