source: trunk/docx4j/src/main/java/org/docx4j/wml/TblWidth.java @ 1770

Revision 1770, 4.0 KB checked in by jharrop, 8 weeks ago (diff)

Define constants.

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.math.BigInteger;
25import javax.xml.bind.Unmarshaller;
26import javax.xml.bind.annotation.XmlAccessType;
27import javax.xml.bind.annotation.XmlAccessorType;
28import javax.xml.bind.annotation.XmlAttribute;
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_TblWidth 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_TblWidth">
41 *   &lt;complexContent>
42 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
43 *       &lt;attribute name="w" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_DecimalNumber" />
44 *       &lt;attribute name="type">
45 *         &lt;simpleType>
46 *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
47 *             &lt;enumeration value="nil"/>
48 *             &lt;enumeration value="pct"/>
49 *             &lt;enumeration value="dxa"/>
50 *             &lt;enumeration value="auto"/>
51 *           &lt;/restriction>
52 *         &lt;/simpleType>
53 *       &lt;/attribute>
54 *     &lt;/restriction>
55 *   &lt;/complexContent>
56 * &lt;/complexType>
57 * </pre>
58 *
59 *
60 */
61@XmlAccessorType(XmlAccessType.FIELD)
62@XmlType(name = "CT_TblWidth")
63public class TblWidth implements Child
64{
65
66        public final static String TYPE_AUTO = "auto";
67        public final static String TYPE_DXA = "dxa"; // twips
68       
69    @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
70    protected BigInteger w;
71    @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
72    protected String type;
73    @XmlTransient
74    private Object parent;
75
76    /**
77     * Gets the value of the w property.
78     *
79     * @return
80     *     possible object is
81     *     {@link BigInteger }
82     *     
83     */
84    public BigInteger getW() {
85        return w;
86    }
87
88    /**
89     * Sets the value of the w property.
90     *
91     * @param value
92     *     allowed object is
93     *     {@link BigInteger }
94     *     
95     */
96    public void setW(BigInteger value) {
97        this.w = value;
98    }
99
100    /**
101     * Gets the value of the type property.
102     *
103     * @return
104     *     possible object is
105     *     {@link String }
106     *     
107     */
108    public String getType() {
109        return type;
110    }
111
112    /**
113     * Sets the value of the type property.
114     *
115     * @param value
116     *     allowed object is
117     *     {@link String }
118     *     
119     */
120    public void setType(String value) {
121        this.type = value;
122    }
123
124    /**
125     * Gets the parent object in the object tree representing the unmarshalled xml document.
126     *
127     * @return
128     *     The parent object.
129     */
130    public Object getParent() {
131        return this.parent;
132    }
133
134    public void setParent(Object parent) {
135        this.parent = parent;
136    }
137
138    /**
139     * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
140     *
141     * @param parent
142     *     The parent object in the object tree.
143     * @param unmarshaller
144     *     The unmarshaller that generated the instance.
145     */
146    public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
147        setParent(parent);
148    }
149
150}
Note: See TracBrowser for help on using the repository browser.