| 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.util.ArrayList; |
|---|
| 25 | import java.util.List; |
|---|
| 26 | import javax.xml.bind.JAXBElement; |
|---|
| 27 | import javax.xml.bind.Unmarshaller; |
|---|
| 28 | import javax.xml.bind.annotation.XmlAccessType; |
|---|
| 29 | import javax.xml.bind.annotation.XmlAccessorType; |
|---|
| 30 | import javax.xml.bind.annotation.XmlAttribute; |
|---|
| 31 | import javax.xml.bind.annotation.XmlElementRef; |
|---|
| 32 | import javax.xml.bind.annotation.XmlElementRefs; |
|---|
| 33 | import javax.xml.bind.annotation.XmlRootElement; |
|---|
| 34 | import javax.xml.bind.annotation.XmlTransient; |
|---|
| 35 | import javax.xml.bind.annotation.XmlType; |
|---|
| 36 | import org.docx4j.math.CTOMath; |
|---|
| 37 | import org.docx4j.math.CTOMathPara; |
|---|
| 38 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | /** |
|---|
| 42 | * <p>Java class for anonymous complex type. |
|---|
| 43 | * |
|---|
| 44 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 45 | * |
|---|
| 46 | * <pre> |
|---|
| 47 | * <complexType> |
|---|
| 48 | * <complexContent> |
|---|
| 49 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 50 | * <sequence> |
|---|
| 51 | * <element name="tblPrEx" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TblPrEx" minOccurs="0"/> |
|---|
| 52 | * <element name="trPr" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TrPr" minOccurs="0"/> |
|---|
| 53 | * <group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_ContentCellContent" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 54 | * </sequence> |
|---|
| 55 | * <attribute name="rsidRPr" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_LongHexNumber" /> |
|---|
| 56 | * <attribute name="rsidR" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_LongHexNumber" /> |
|---|
| 57 | * <attribute name="rsidDel" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_LongHexNumber" /> |
|---|
| 58 | * <attribute name="rsidTr" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_LongHexNumber" /> |
|---|
| 59 | * </restriction> |
|---|
| 60 | * </complexContent> |
|---|
| 61 | * </complexType> |
|---|
| 62 | * </pre> |
|---|
| 63 | * |
|---|
| 64 | * |
|---|
| 65 | */ |
|---|
| 66 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 67 | @XmlType(name = "", propOrder = { |
|---|
| 68 | "tblPrEx", |
|---|
| 69 | "trPr", |
|---|
| 70 | "egContentCellContent" |
|---|
| 71 | }) |
|---|
| 72 | @XmlRootElement(name = "tr") |
|---|
| 73 | public class Tr implements Child, ContentAccessor |
|---|
| 74 | { |
|---|
| 75 | |
|---|
| 76 | protected CTTblPrEx tblPrEx; |
|---|
| 77 | protected TrPr trPr; |
|---|
| 78 | @XmlElementRefs({ |
|---|
| 79 | @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 80 | @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 81 | @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 82 | @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 83 | @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class), |
|---|
| 84 | @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 85 | @XmlElementRef(name = "tc", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 86 | @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class), |
|---|
| 87 | @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 88 | @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 89 | @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 90 | @XmlElementRef(name = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 91 | @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 92 | @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 93 | @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 94 | @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class), |
|---|
| 95 | @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 96 | @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 97 | @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 98 | @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class), |
|---|
| 99 | @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class), |
|---|
| 100 | @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 101 | @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 102 | @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 103 | @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 104 | @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 105 | @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 106 | @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class) |
|---|
| 107 | }) |
|---|
| 108 | protected List<Object> egContentCellContent; |
|---|
| 109 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 110 | protected String rsidRPr; |
|---|
| 111 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 112 | protected String rsidR; |
|---|
| 113 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 114 | protected String rsidDel; |
|---|
| 115 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 116 | protected String rsidTr; |
|---|
| 117 | @XmlTransient |
|---|
| 118 | private Object parent; |
|---|
| 119 | |
|---|
| 120 | /** |
|---|
| 121 | * Gets the value of the tblPrEx property. |
|---|
| 122 | * |
|---|
| 123 | * @return |
|---|
| 124 | * possible object is |
|---|
| 125 | * {@link CTTblPrEx } |
|---|
| 126 | * |
|---|
| 127 | */ |
|---|
| 128 | public CTTblPrEx getTblPrEx() { |
|---|
| 129 | return tblPrEx; |
|---|
| 130 | } |
|---|
| 131 | |
|---|
| 132 | /** |
|---|
| 133 | * Sets the value of the tblPrEx property. |
|---|
| 134 | * |
|---|
| 135 | * @param value |
|---|
| 136 | * allowed object is |
|---|
| 137 | * {@link CTTblPrEx } |
|---|
| 138 | * |
|---|
| 139 | */ |
|---|
| 140 | public void setTblPrEx(CTTblPrEx value) { |
|---|
| 141 | this.tblPrEx = value; |
|---|
| 142 | } |
|---|
| 143 | |
|---|
| 144 | /** |
|---|
| 145 | * Gets the value of the trPr property. |
|---|
| 146 | * |
|---|
| 147 | * @return |
|---|
| 148 | * possible object is |
|---|
| 149 | * {@link TrPr } |
|---|
| 150 | * |
|---|
| 151 | */ |
|---|
| 152 | public TrPr getTrPr() { |
|---|
| 153 | return trPr; |
|---|
| 154 | } |
|---|
| 155 | |
|---|
| 156 | /** |
|---|
| 157 | * Sets the value of the trPr property. |
|---|
| 158 | * |
|---|
| 159 | * @param value |
|---|
| 160 | * allowed object is |
|---|
| 161 | * {@link TrPr } |
|---|
| 162 | * |
|---|
| 163 | */ |
|---|
| 164 | public void setTrPr(TrPr value) { |
|---|
| 165 | this.trPr = value; |
|---|
| 166 | } |
|---|
| 167 | |
|---|
| 168 | /** |
|---|
| 169 | * Gets the value of the egContentCellContent property. |
|---|
| 170 | * |
|---|
| 171 | * <p> |
|---|
| 172 | * This accessor method returns a reference to the live list, |
|---|
| 173 | * not a snapshot. Therefore any modification you make to the |
|---|
| 174 | * returned list will be present inside the JAXB object. |
|---|
| 175 | * This is why there is not a <CODE>set</CODE> method for the egContentCellContent property. |
|---|
| 176 | * |
|---|
| 177 | * <p> |
|---|
| 178 | * For example, to add a new item, do as follows: |
|---|
| 179 | * <pre> |
|---|
| 180 | * getEGContentCellContent().add(newItem); |
|---|
| 181 | * </pre> |
|---|
| 182 | * |
|---|
| 183 | * |
|---|
| 184 | * <p> |
|---|
| 185 | * Objects of the following type(s) are allowed in the list |
|---|
| 186 | * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >} |
|---|
| 187 | * {@link JAXBElement }{@code <}{@link CTSdtCell }{@code >} |
|---|
| 188 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 189 | * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >} |
|---|
| 190 | * {@link CommentRangeStart } |
|---|
| 191 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 192 | * {@link JAXBElement }{@code <}{@link Tc }{@code >} |
|---|
| 193 | * {@link RunIns } |
|---|
| 194 | * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >} |
|---|
| 195 | * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >} |
|---|
| 196 | * {@link JAXBElement }{@code <}{@link CTOMath }{@code >} |
|---|
| 197 | * {@link JAXBElement }{@code <}{@link CTCustomXmlCell }{@code >} |
|---|
| 198 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 199 | * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >} |
|---|
| 200 | * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >} |
|---|
| 201 | * {@link CommentRangeEnd } |
|---|
| 202 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 203 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 204 | * {@link JAXBElement }{@code <}{@link CTPerm }{@code >} |
|---|
| 205 | * {@link ProofErr } |
|---|
| 206 | * {@link RunDel } |
|---|
| 207 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 208 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 209 | * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >} |
|---|
| 210 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 211 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 212 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 213 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 214 | * |
|---|
| 215 | * |
|---|
| 216 | */ |
|---|
| 217 | @Deprecated |
|---|
| 218 | public List<Object> getEGContentCellContent() { |
|---|
| 219 | if (egContentCellContent == null) { |
|---|
| 220 | egContentCellContent = new ArrayList<Object>(); |
|---|
| 221 | } |
|---|
| 222 | return this.egContentCellContent; |
|---|
| 223 | } |
|---|
| 224 | |
|---|
| 225 | /** |
|---|
| 226 | * Get the content of this element. |
|---|
| 227 | * @since 2.7 |
|---|
| 228 | */ |
|---|
| 229 | public List<Object> getContent() { |
|---|
| 230 | if (egContentCellContent == null) { |
|---|
| 231 | egContentCellContent = new ArrayList<Object>(); |
|---|
| 232 | } |
|---|
| 233 | return this.egContentCellContent; |
|---|
| 234 | } |
|---|
| 235 | |
|---|
| 236 | /** |
|---|
| 237 | * Gets the value of the rsidRPr property. |
|---|
| 238 | * |
|---|
| 239 | * @return |
|---|
| 240 | * possible object is |
|---|
| 241 | * {@link String } |
|---|
| 242 | * |
|---|
| 243 | */ |
|---|
| 244 | public String getRsidRPr() { |
|---|
| 245 | return rsidRPr; |
|---|
| 246 | } |
|---|
| 247 | |
|---|
| 248 | /** |
|---|
| 249 | * Sets the value of the rsidRPr property. |
|---|
| 250 | * |
|---|
| 251 | * @param value |
|---|
| 252 | * allowed object is |
|---|
| 253 | * {@link String } |
|---|
| 254 | * |
|---|
| 255 | */ |
|---|
| 256 | public void setRsidRPr(String value) { |
|---|
| 257 | this.rsidRPr = value; |
|---|
| 258 | } |
|---|
| 259 | |
|---|
| 260 | /** |
|---|
| 261 | * Gets the value of the rsidR property. |
|---|
| 262 | * |
|---|
| 263 | * @return |
|---|
| 264 | * possible object is |
|---|
| 265 | * {@link String } |
|---|
| 266 | * |
|---|
| 267 | */ |
|---|
| 268 | public String getRsidR() { |
|---|
| 269 | return rsidR; |
|---|
| 270 | } |
|---|
| 271 | |
|---|
| 272 | /** |
|---|
| 273 | * Sets the value of the rsidR property. |
|---|
| 274 | * |
|---|
| 275 | * @param value |
|---|
| 276 | * allowed object is |
|---|
| 277 | * {@link String } |
|---|
| 278 | * |
|---|
| 279 | */ |
|---|
| 280 | public void setRsidR(String value) { |
|---|
| 281 | this.rsidR = value; |
|---|
| 282 | } |
|---|
| 283 | |
|---|
| 284 | /** |
|---|
| 285 | * Gets the value of the rsidDel property. |
|---|
| 286 | * |
|---|
| 287 | * @return |
|---|
| 288 | * possible object is |
|---|
| 289 | * {@link String } |
|---|
| 290 | * |
|---|
| 291 | */ |
|---|
| 292 | public String getRsidDel() { |
|---|
| 293 | return rsidDel; |
|---|
| 294 | } |
|---|
| 295 | |
|---|
| 296 | /** |
|---|
| 297 | * Sets the value of the rsidDel property. |
|---|
| 298 | * |
|---|
| 299 | * @param value |
|---|
| 300 | * allowed object is |
|---|
| 301 | * {@link String } |
|---|
| 302 | * |
|---|
| 303 | */ |
|---|
| 304 | public void setRsidDel(String value) { |
|---|
| 305 | this.rsidDel = value; |
|---|
| 306 | } |
|---|
| 307 | |
|---|
| 308 | /** |
|---|
| 309 | * Gets the value of the rsidTr property. |
|---|
| 310 | * |
|---|
| 311 | * @return |
|---|
| 312 | * possible object is |
|---|
| 313 | * {@link String } |
|---|
| 314 | * |
|---|
| 315 | */ |
|---|
| 316 | public String getRsidTr() { |
|---|
| 317 | return rsidTr; |
|---|
| 318 | } |
|---|
| 319 | |
|---|
| 320 | /** |
|---|
| 321 | * Sets the value of the rsidTr property. |
|---|
| 322 | * |
|---|
| 323 | * @param value |
|---|
| 324 | * allowed object is |
|---|
| 325 | * {@link String } |
|---|
| 326 | * |
|---|
| 327 | */ |
|---|
| 328 | public void setRsidTr(String value) { |
|---|
| 329 | this.rsidTr = value; |
|---|
| 330 | } |
|---|
| 331 | |
|---|
| 332 | /** |
|---|
| 333 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 334 | * |
|---|
| 335 | * @return |
|---|
| 336 | * The parent object. |
|---|
| 337 | */ |
|---|
| 338 | public Object getParent() { |
|---|
| 339 | return this.parent; |
|---|
| 340 | } |
|---|
| 341 | |
|---|
| 342 | public void setParent(Object parent) { |
|---|
| 343 | this.parent = parent; |
|---|
| 344 | } |
|---|
| 345 | |
|---|
| 346 | /** |
|---|
| 347 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 348 | * |
|---|
| 349 | * @param parent |
|---|
| 350 | * The parent object in the object tree. |
|---|
| 351 | * @param unmarshaller |
|---|
| 352 | * The unmarshaller that generated the instance. |
|---|
| 353 | */ |
|---|
| 354 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 355 | setParent(parent); |
|---|
| 356 | } |
|---|
| 357 | |
|---|
| 358 | } |
|---|