| 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 javax.xml.bind.Unmarshaller; |
|---|
| 25 | import javax.xml.bind.annotation.XmlAccessType; |
|---|
| 26 | import javax.xml.bind.annotation.XmlAccessorType; |
|---|
| 27 | import javax.xml.bind.annotation.XmlAttribute; |
|---|
| 28 | import javax.xml.bind.annotation.XmlRootElement; |
|---|
| 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_FldChar complex type. |
|---|
| 36 | * |
|---|
| 37 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 38 | * |
|---|
| 39 | * <pre> |
|---|
| 40 | * <complexType name="CT_FldChar"> |
|---|
| 41 | * <complexContent> |
|---|
| 42 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 43 | * <choice> |
|---|
| 44 | * <element name="fldData" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_Text" minOccurs="0"/> |
|---|
| 45 | * <element name="ffData" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FFData" minOccurs="0"/> |
|---|
| 46 | * <element name="numberingChange" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TrackChangeNumbering" minOccurs="0"/> |
|---|
| 47 | * </choice> |
|---|
| 48 | * <attribute name="fldCharType" use="required" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_FldCharType" /> |
|---|
| 49 | * <attribute name="fldLock" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /> |
|---|
| 50 | * <attribute name="dirty" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /> |
|---|
| 51 | * </restriction> |
|---|
| 52 | * </complexContent> |
|---|
| 53 | * </complexType> |
|---|
| 54 | * </pre> |
|---|
| 55 | * |
|---|
| 56 | * |
|---|
| 57 | */ |
|---|
| 58 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 59 | @XmlType(name = "CT_FldChar", propOrder = { |
|---|
| 60 | "fldData", |
|---|
| 61 | "ffData", |
|---|
| 62 | "numberingChange" |
|---|
| 63 | }) |
|---|
| 64 | @XmlRootElement(name = "fldChar") |
|---|
| 65 | public class FldChar |
|---|
| 66 | implements Child |
|---|
| 67 | { |
|---|
| 68 | |
|---|
| 69 | protected Text fldData; |
|---|
| 70 | protected CTFFData ffData; |
|---|
| 71 | protected CTTrackChangeNumbering numberingChange; |
|---|
| 72 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", required = true) |
|---|
| 73 | protected STFldCharType fldCharType; |
|---|
| 74 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 75 | protected Boolean fldLock; |
|---|
| 76 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 77 | protected Boolean dirty; |
|---|
| 78 | @XmlTransient |
|---|
| 79 | private Object parent; |
|---|
| 80 | |
|---|
| 81 | /** |
|---|
| 82 | * Gets the value of the fldData property. |
|---|
| 83 | * |
|---|
| 84 | * @return |
|---|
| 85 | * possible object is |
|---|
| 86 | * {@link Text } |
|---|
| 87 | * |
|---|
| 88 | */ |
|---|
| 89 | public Text getFldData() { |
|---|
| 90 | return fldData; |
|---|
| 91 | } |
|---|
| 92 | |
|---|
| 93 | /** |
|---|
| 94 | * Sets the value of the fldData property. |
|---|
| 95 | * |
|---|
| 96 | * @param value |
|---|
| 97 | * allowed object is |
|---|
| 98 | * {@link Text } |
|---|
| 99 | * |
|---|
| 100 | */ |
|---|
| 101 | public void setFldData(Text value) { |
|---|
| 102 | this.fldData = value; |
|---|
| 103 | } |
|---|
| 104 | |
|---|
| 105 | /** |
|---|
| 106 | * Gets the value of the ffData property. |
|---|
| 107 | * |
|---|
| 108 | * @return |
|---|
| 109 | * possible object is |
|---|
| 110 | * {@link CTFFData } |
|---|
| 111 | * |
|---|
| 112 | */ |
|---|
| 113 | public CTFFData getFfData() { |
|---|
| 114 | return ffData; |
|---|
| 115 | } |
|---|
| 116 | |
|---|
| 117 | /** |
|---|
| 118 | * Sets the value of the ffData property. |
|---|
| 119 | * |
|---|
| 120 | * @param value |
|---|
| 121 | * allowed object is |
|---|
| 122 | * {@link CTFFData } |
|---|
| 123 | * |
|---|
| 124 | */ |
|---|
| 125 | public void setFfData(CTFFData value) { |
|---|
| 126 | this.ffData = value; |
|---|
| 127 | } |
|---|
| 128 | |
|---|
| 129 | /** |
|---|
| 130 | * Gets the value of the numberingChange property. |
|---|
| 131 | * |
|---|
| 132 | * @return |
|---|
| 133 | * possible object is |
|---|
| 134 | * {@link CTTrackChangeNumbering } |
|---|
| 135 | * |
|---|
| 136 | */ |
|---|
| 137 | public CTTrackChangeNumbering getNumberingChange() { |
|---|
| 138 | return numberingChange; |
|---|
| 139 | } |
|---|
| 140 | |
|---|
| 141 | /** |
|---|
| 142 | * Sets the value of the numberingChange property. |
|---|
| 143 | * |
|---|
| 144 | * @param value |
|---|
| 145 | * allowed object is |
|---|
| 146 | * {@link CTTrackChangeNumbering } |
|---|
| 147 | * |
|---|
| 148 | */ |
|---|
| 149 | public void setNumberingChange(CTTrackChangeNumbering value) { |
|---|
| 150 | this.numberingChange = value; |
|---|
| 151 | } |
|---|
| 152 | |
|---|
| 153 | /** |
|---|
| 154 | * Gets the value of the fldCharType property. |
|---|
| 155 | * |
|---|
| 156 | * @return |
|---|
| 157 | * possible object is |
|---|
| 158 | * {@link STFldCharType } |
|---|
| 159 | * |
|---|
| 160 | */ |
|---|
| 161 | public STFldCharType getFldCharType() { |
|---|
| 162 | return fldCharType; |
|---|
| 163 | } |
|---|
| 164 | |
|---|
| 165 | /** |
|---|
| 166 | * Sets the value of the fldCharType property. |
|---|
| 167 | * |
|---|
| 168 | * @param value |
|---|
| 169 | * allowed object is |
|---|
| 170 | * {@link STFldCharType } |
|---|
| 171 | * |
|---|
| 172 | */ |
|---|
| 173 | public void setFldCharType(STFldCharType value) { |
|---|
| 174 | this.fldCharType = value; |
|---|
| 175 | } |
|---|
| 176 | |
|---|
| 177 | /** |
|---|
| 178 | * Gets the value of the fldLock property. |
|---|
| 179 | * |
|---|
| 180 | * @return |
|---|
| 181 | * possible object is |
|---|
| 182 | * {@link Boolean } |
|---|
| 183 | * |
|---|
| 184 | */ |
|---|
| 185 | public boolean isFldLock() { |
|---|
| 186 | if (fldLock == null) { |
|---|
| 187 | return true; |
|---|
| 188 | } else { |
|---|
| 189 | return fldLock; |
|---|
| 190 | } |
|---|
| 191 | } |
|---|
| 192 | |
|---|
| 193 | /** |
|---|
| 194 | * Sets the value of the fldLock property. |
|---|
| 195 | * |
|---|
| 196 | * @param value |
|---|
| 197 | * allowed object is |
|---|
| 198 | * {@link Boolean } |
|---|
| 199 | * |
|---|
| 200 | */ |
|---|
| 201 | public void setFldLock(Boolean value) { |
|---|
| 202 | this.fldLock = value; |
|---|
| 203 | } |
|---|
| 204 | |
|---|
| 205 | /** |
|---|
| 206 | * Gets the value of the dirty property. |
|---|
| 207 | * |
|---|
| 208 | * @return |
|---|
| 209 | * possible object is |
|---|
| 210 | * {@link Boolean } |
|---|
| 211 | * |
|---|
| 212 | */ |
|---|
| 213 | public boolean isDirty() { |
|---|
| 214 | if (dirty == null) { |
|---|
| 215 | return true; |
|---|
| 216 | } else { |
|---|
| 217 | return dirty; |
|---|
| 218 | } |
|---|
| 219 | } |
|---|
| 220 | |
|---|
| 221 | /** |
|---|
| 222 | * Sets the value of the dirty property. |
|---|
| 223 | * |
|---|
| 224 | * @param value |
|---|
| 225 | * allowed object is |
|---|
| 226 | * {@link Boolean } |
|---|
| 227 | * |
|---|
| 228 | */ |
|---|
| 229 | public void setDirty(Boolean value) { |
|---|
| 230 | this.dirty = value; |
|---|
| 231 | } |
|---|
| 232 | |
|---|
| 233 | /** |
|---|
| 234 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 235 | * |
|---|
| 236 | * @return |
|---|
| 237 | * The parent object. |
|---|
| 238 | */ |
|---|
| 239 | public Object getParent() { |
|---|
| 240 | return this.parent; |
|---|
| 241 | } |
|---|
| 242 | |
|---|
| 243 | public void setParent(Object parent) { |
|---|
| 244 | this.parent = parent; |
|---|
| 245 | } |
|---|
| 246 | |
|---|
| 247 | /** |
|---|
| 248 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 249 | * |
|---|
| 250 | * @param parent |
|---|
| 251 | * The parent object in the object tree. |
|---|
| 252 | * @param unmarshaller |
|---|
| 253 | * The unmarshaller that generated the instance. |
|---|
| 254 | */ |
|---|
| 255 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 256 | setParent(parent); |
|---|
| 257 | } |
|---|
| 258 | |
|---|
| 259 | } |
|---|