| 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 | |
|---|
| 22 | package org.docx4j.wml; |
|---|
| 23 | |
|---|
| 24 | import java.math.BigInteger; |
|---|
| 25 | import javax.xml.bind.Unmarshaller; |
|---|
| 26 | import javax.xml.bind.annotation.XmlAccessType; |
|---|
| 27 | import javax.xml.bind.annotation.XmlAccessorType; |
|---|
| 28 | import javax.xml.bind.annotation.XmlAttribute; |
|---|
| 29 | import javax.xml.bind.annotation.XmlTransient; |
|---|
| 30 | import javax.xml.bind.annotation.XmlType; |
|---|
| 31 | import 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 | * <complexType name="CT_TblWidth"> |
|---|
| 41 | * <complexContent> |
|---|
| 42 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 43 | * <attribute name="w" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_DecimalNumber" /> |
|---|
| 44 | * <attribute name="type"> |
|---|
| 45 | * <simpleType> |
|---|
| 46 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> |
|---|
| 47 | * <enumeration value="nil"/> |
|---|
| 48 | * <enumeration value="pct"/> |
|---|
| 49 | * <enumeration value="dxa"/> |
|---|
| 50 | * <enumeration value="auto"/> |
|---|
| 51 | * </restriction> |
|---|
| 52 | * </simpleType> |
|---|
| 53 | * </attribute> |
|---|
| 54 | * </restriction> |
|---|
| 55 | * </complexContent> |
|---|
| 56 | * </complexType> |
|---|
| 57 | * </pre> |
|---|
| 58 | * |
|---|
| 59 | * |
|---|
| 60 | */ |
|---|
| 61 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 62 | @XmlType(name = "CT_TblWidth") |
|---|
| 63 | public 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 | } |
|---|