| 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="comment" maxOccurs="unbounded" minOccurs="0"> |
|---|
| 52 | * <complexType> |
|---|
| 53 | * <complexContent> |
|---|
| 54 | * <extension base="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TrackChange"> |
|---|
| 55 | * <sequence> |
|---|
| 56 | * <group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_BlockLevelElts" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 57 | * </sequence> |
|---|
| 58 | * <attribute name="initials" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" /> |
|---|
| 59 | * </extension> |
|---|
| 60 | * </complexContent> |
|---|
| 61 | * </complexType> |
|---|
| 62 | * </element> |
|---|
| 63 | * </sequence> |
|---|
| 64 | * </restriction> |
|---|
| 65 | * </complexContent> |
|---|
| 66 | * </complexType> |
|---|
| 67 | * </pre> |
|---|
| 68 | * |
|---|
| 69 | * |
|---|
| 70 | */ |
|---|
| 71 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 72 | @XmlType(name = "", propOrder = { |
|---|
| 73 | "comment" |
|---|
| 74 | }) |
|---|
| 75 | @XmlRootElement(name = "comments") |
|---|
| 76 | public class Comments |
|---|
| 77 | implements Child |
|---|
| 78 | { |
|---|
| 79 | |
|---|
| 80 | protected List<Comments.Comment> comment; |
|---|
| 81 | @XmlTransient |
|---|
| 82 | private Object parent; |
|---|
| 83 | |
|---|
| 84 | /** |
|---|
| 85 | * Gets the value of the comment property. |
|---|
| 86 | * |
|---|
| 87 | * <p> |
|---|
| 88 | * This accessor method returns a reference to the live list, |
|---|
| 89 | * not a snapshot. Therefore any modification you make to the |
|---|
| 90 | * returned list will be present inside the JAXB object. |
|---|
| 91 | * This is why there is not a <CODE>set</CODE> method for the comment property. |
|---|
| 92 | * |
|---|
| 93 | * <p> |
|---|
| 94 | * For example, to add a new item, do as follows: |
|---|
| 95 | * <pre> |
|---|
| 96 | * getComment().add(newItem); |
|---|
| 97 | * </pre> |
|---|
| 98 | * |
|---|
| 99 | * |
|---|
| 100 | * <p> |
|---|
| 101 | * Objects of the following type(s) are allowed in the list |
|---|
| 102 | * {@link Comments.Comment } |
|---|
| 103 | * |
|---|
| 104 | * |
|---|
| 105 | */ |
|---|
| 106 | public List<Comments.Comment> getComment() { |
|---|
| 107 | if (comment == null) { |
|---|
| 108 | comment = new ArrayList<Comments.Comment>(); |
|---|
| 109 | } |
|---|
| 110 | return this.comment; |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | /** |
|---|
| 114 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 115 | * |
|---|
| 116 | * @return |
|---|
| 117 | * The parent object. |
|---|
| 118 | */ |
|---|
| 119 | public Object getParent() { |
|---|
| 120 | return this.parent; |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | public void setParent(Object parent) { |
|---|
| 124 | this.parent = parent; |
|---|
| 125 | } |
|---|
| 126 | |
|---|
| 127 | /** |
|---|
| 128 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 129 | * |
|---|
| 130 | * @param parent |
|---|
| 131 | * The parent object in the object tree. |
|---|
| 132 | * @param unmarshaller |
|---|
| 133 | * The unmarshaller that generated the instance. |
|---|
| 134 | */ |
|---|
| 135 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 136 | setParent(parent); |
|---|
| 137 | } |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | /** |
|---|
| 141 | * <p>Java class for anonymous complex type. |
|---|
| 142 | * |
|---|
| 143 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 144 | * |
|---|
| 145 | * <pre> |
|---|
| 146 | * <complexType> |
|---|
| 147 | * <complexContent> |
|---|
| 148 | * <extension base="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TrackChange"> |
|---|
| 149 | * <sequence> |
|---|
| 150 | * <group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_BlockLevelElts" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 151 | * </sequence> |
|---|
| 152 | * <attribute name="initials" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" /> |
|---|
| 153 | * </extension> |
|---|
| 154 | * </complexContent> |
|---|
| 155 | * </complexType> |
|---|
| 156 | * </pre> |
|---|
| 157 | * |
|---|
| 158 | * |
|---|
| 159 | */ |
|---|
| 160 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 161 | @XmlType(name = "", propOrder = { |
|---|
| 162 | "egBlockLevelElts" |
|---|
| 163 | }) |
|---|
| 164 | public static class Comment |
|---|
| 165 | extends CTTrackChange |
|---|
| 166 | implements Child |
|---|
| 167 | { |
|---|
| 168 | |
|---|
| 169 | @XmlElementRefs({ |
|---|
| 170 | @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 171 | @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 172 | @XmlElementRef(name = "tbl", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 173 | @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class), |
|---|
| 174 | @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 175 | @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 176 | @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 177 | @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class), |
|---|
| 178 | @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 179 | @XmlElementRef(name = "p", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = P.class), |
|---|
| 180 | @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 181 | @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 182 | @XmlElementRef(name = "altChunk", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 183 | @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = SdtBlock.class), |
|---|
| 184 | @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 185 | @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 186 | @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class), |
|---|
| 187 | @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 188 | @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class), |
|---|
| 189 | @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class), |
|---|
| 190 | @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 191 | @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 192 | @XmlElementRef(name = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 193 | @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 194 | @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 195 | @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 196 | @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 197 | @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 198 | @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 199 | @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class) |
|---|
| 200 | }) |
|---|
| 201 | protected List<Object> egBlockLevelElts; |
|---|
| 202 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 203 | protected String initials; |
|---|
| 204 | @XmlTransient |
|---|
| 205 | private Object parent; |
|---|
| 206 | |
|---|
| 207 | /** |
|---|
| 208 | * Gets the value of the egBlockLevelElts property. |
|---|
| 209 | * |
|---|
| 210 | * <p> |
|---|
| 211 | * This accessor method returns a reference to the live list, |
|---|
| 212 | * not a snapshot. Therefore any modification you make to the |
|---|
| 213 | * returned list will be present inside the JAXB object. |
|---|
| 214 | * This is why there is not a <CODE>set</CODE> method for the egBlockLevelElts property. |
|---|
| 215 | * |
|---|
| 216 | * <p> |
|---|
| 217 | * For example, to add a new item, do as follows: |
|---|
| 218 | * <pre> |
|---|
| 219 | * getEGBlockLevelElts().add(newItem); |
|---|
| 220 | * </pre> |
|---|
| 221 | * |
|---|
| 222 | * |
|---|
| 223 | * <p> |
|---|
| 224 | * Objects of the following type(s) are allowed in the list |
|---|
| 225 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 226 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 227 | * {@link JAXBElement }{@code <}{@link Tbl }{@code >} |
|---|
| 228 | * {@link CommentRangeStart } |
|---|
| 229 | * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >} |
|---|
| 230 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 231 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 232 | * {@link RunIns } |
|---|
| 233 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 234 | * {@link P } |
|---|
| 235 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 236 | * {@link JAXBElement }{@code <}{@link CTOMath }{@code >} |
|---|
| 237 | * {@link JAXBElement }{@code <}{@link CTAltChunk }{@code >} |
|---|
| 238 | * {@link SdtBlock } |
|---|
| 239 | * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >} |
|---|
| 240 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 241 | * {@link CommentRangeEnd } |
|---|
| 242 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 243 | * {@link ProofErr } |
|---|
| 244 | * {@link RunDel } |
|---|
| 245 | * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >} |
|---|
| 246 | * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >} |
|---|
| 247 | * {@link JAXBElement }{@code <}{@link CTCustomXmlBlock }{@code >} |
|---|
| 248 | * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >} |
|---|
| 249 | * {@link JAXBElement }{@code <}{@link CTPerm }{@code >} |
|---|
| 250 | * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >} |
|---|
| 251 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 252 | * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >} |
|---|
| 253 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 254 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 255 | * |
|---|
| 256 | * |
|---|
| 257 | */ |
|---|
| 258 | public List<Object> getEGBlockLevelElts() { |
|---|
| 259 | if (egBlockLevelElts == null) { |
|---|
| 260 | egBlockLevelElts = new ArrayList<Object>(); |
|---|
| 261 | } |
|---|
| 262 | return this.egBlockLevelElts; |
|---|
| 263 | } |
|---|
| 264 | |
|---|
| 265 | /** |
|---|
| 266 | * Gets the value of the initials property. |
|---|
| 267 | * |
|---|
| 268 | * @return |
|---|
| 269 | * possible object is |
|---|
| 270 | * {@link String } |
|---|
| 271 | * |
|---|
| 272 | */ |
|---|
| 273 | public String getInitials() { |
|---|
| 274 | return initials; |
|---|
| 275 | } |
|---|
| 276 | |
|---|
| 277 | /** |
|---|
| 278 | * Sets the value of the initials property. |
|---|
| 279 | * |
|---|
| 280 | * @param value |
|---|
| 281 | * allowed object is |
|---|
| 282 | * {@link String } |
|---|
| 283 | * |
|---|
| 284 | */ |
|---|
| 285 | public void setInitials(String value) { |
|---|
| 286 | this.initials = value; |
|---|
| 287 | } |
|---|
| 288 | |
|---|
| 289 | /** |
|---|
| 290 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 291 | * |
|---|
| 292 | * @return |
|---|
| 293 | * The parent object. |
|---|
| 294 | */ |
|---|
| 295 | public Object getParent() { |
|---|
| 296 | return this.parent; |
|---|
| 297 | } |
|---|
| 298 | |
|---|
| 299 | public void setParent(Object parent) { |
|---|
| 300 | this.parent = parent; |
|---|
| 301 | } |
|---|
| 302 | |
|---|
| 303 | /** |
|---|
| 304 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 305 | * |
|---|
| 306 | * @param parent |
|---|
| 307 | * The parent object in the object tree. |
|---|
| 308 | * @param unmarshaller |
|---|
| 309 | * The unmarshaller that generated the instance. |
|---|
| 310 | */ |
|---|
| 311 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 312 | setParent(parent); |
|---|
| 313 | } |
|---|
| 314 | |
|---|
| 315 | } |
|---|
| 316 | |
|---|
| 317 | } |
|---|