PageRenderTime 34ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/src/main/java/org/docx4j/wml/Comments.java

http://github.com/plutext/docx4j
Java | 317 lines | 110 code | 21 blank | 186 comment | 4 complexity | d7b5dbdf6b8476b1a29fba9a5859a873 MD5 | raw file
Possible License(s): Apache-2.0
  1. /*
  2. * Copyright 2007-2008, Plutext Pty Ltd.
  3. *
  4. * This file is part of docx4j.
  5. docx4j is licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. */
  15. package org.docx4j.wml;
  16. import java.util.ArrayList;
  17. import java.util.List;
  18. import javax.xml.bind.JAXBElement;
  19. import javax.xml.bind.Unmarshaller;
  20. import javax.xml.bind.annotation.XmlAccessType;
  21. import javax.xml.bind.annotation.XmlAccessorType;
  22. import javax.xml.bind.annotation.XmlAttribute;
  23. import javax.xml.bind.annotation.XmlElementRef;
  24. import javax.xml.bind.annotation.XmlElementRefs;
  25. import javax.xml.bind.annotation.XmlRootElement;
  26. import javax.xml.bind.annotation.XmlTransient;
  27. import javax.xml.bind.annotation.XmlType;
  28. import org.docx4j.math.CTOMath;
  29. import org.docx4j.math.CTOMathPara;
  30. import org.jvnet.jaxb2_commons.ppp.Child;
  31. /**
  32. * <p>Java class for anonymous complex type.
  33. *
  34. * <p>The following schema fragment specifies the expected content contained within this class.
  35. *
  36. * <pre>
  37. * &lt;complexType>
  38. * &lt;complexContent>
  39. * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  40. * &lt;sequence>
  41. * &lt;element name="comment" maxOccurs="unbounded" minOccurs="0">
  42. * &lt;complexType>
  43. * &lt;complexContent>
  44. * &lt;extension base="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TrackChange">
  45. * &lt;sequence>
  46. * &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_BlockLevelElts" maxOccurs="unbounded" minOccurs="0"/>
  47. * &lt;/sequence>
  48. * &lt;attribute name="initials" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
  49. * &lt;/extension>
  50. * &lt;/complexContent>
  51. * &lt;/complexType>
  52. * &lt;/element>
  53. * &lt;/sequence>
  54. * &lt;/restriction>
  55. * &lt;/complexContent>
  56. * &lt;/complexType>
  57. * </pre>
  58. *
  59. *
  60. */
  61. @XmlAccessorType(XmlAccessType.FIELD)
  62. @XmlType(name = "", propOrder = {
  63. "comment"
  64. })
  65. @XmlRootElement(name = "comments")
  66. public class Comments
  67. implements Child
  68. {
  69. protected List<Comments.Comment> comment;
  70. @XmlTransient
  71. private Object parent;
  72. /**
  73. * Gets the value of the comment property.
  74. *
  75. * <p>
  76. * This accessor method returns a reference to the live list,
  77. * not a snapshot. Therefore any modification you make to the
  78. * returned list will be present inside the JAXB object.
  79. * This is why there is not a <CODE>set</CODE> method for the comment property.
  80. *
  81. * <p>
  82. * For example, to add a new item, do as follows:
  83. * <pre>
  84. * getComment().add(newItem);
  85. * </pre>
  86. *
  87. *
  88. * <p>
  89. * Objects of the following type(s) are allowed in the list
  90. * {@link Comments.Comment }
  91. *
  92. *
  93. */
  94. public List<Comments.Comment> getComment() {
  95. if (comment == null) {
  96. comment = new ArrayList<Comments.Comment>();
  97. }
  98. return this.comment;
  99. }
  100. /**
  101. * Gets the parent object in the object tree representing the unmarshalled xml document.
  102. *
  103. * @return
  104. * The parent object.
  105. */
  106. public Object getParent() {
  107. return this.parent;
  108. }
  109. public void setParent(Object parent) {
  110. this.parent = parent;
  111. }
  112. /**
  113. * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
  114. *
  115. * @param parent
  116. * The parent object in the object tree.
  117. * @param unmarshaller
  118. * The unmarshaller that generated the instance.
  119. */
  120. public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
  121. setParent(parent);
  122. }
  123. /**
  124. * <p>Java class for anonymous complex type.
  125. *
  126. * <p>The following schema fragment specifies the expected content contained within this class.
  127. *
  128. * <pre>
  129. * &lt;complexType>
  130. * &lt;complexContent>
  131. * &lt;extension base="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TrackChange">
  132. * &lt;sequence>
  133. * &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_BlockLevelElts" maxOccurs="unbounded" minOccurs="0"/>
  134. * &lt;/sequence>
  135. * &lt;attribute name="initials" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
  136. * &lt;/extension>
  137. * &lt;/complexContent>
  138. * &lt;/complexType>
  139. * </pre>
  140. *
  141. *
  142. */
  143. @XmlAccessorType(XmlAccessType.FIELD)
  144. @XmlType(name = "", propOrder = {
  145. "egBlockLevelElts"
  146. })
  147. public static class Comment
  148. extends CTTrackChange
  149. implements Child
  150. {
  151. @XmlElementRefs({
  152. @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  153. @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  154. @XmlElementRef(name = "tbl", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  155. @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class),
  156. @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  157. @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  158. @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  159. @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class),
  160. @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  161. @XmlElementRef(name = "p", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = P.class),
  162. @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  163. @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  164. @XmlElementRef(name = "altChunk", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  165. @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = SdtBlock.class),
  166. @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  167. @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  168. @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class),
  169. @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  170. @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class),
  171. @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class),
  172. @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  173. @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  174. @XmlElementRef(name = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  175. @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  176. @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  177. @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  178. @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  179. @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  180. @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  181. @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class)
  182. })
  183. protected List<Object> egBlockLevelElts;
  184. @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
  185. protected String initials;
  186. @XmlTransient
  187. private Object parent;
  188. /**
  189. * Gets the value of the egBlockLevelElts property.
  190. *
  191. * <p>
  192. * This accessor method returns a reference to the live list,
  193. * not a snapshot. Therefore any modification you make to the
  194. * returned list will be present inside the JAXB object.
  195. * This is why there is not a <CODE>set</CODE> method for the egBlockLevelElts property.
  196. *
  197. * <p>
  198. * For example, to add a new item, do as follows:
  199. * <pre>
  200. * getEGBlockLevelElts().add(newItem);
  201. * </pre>
  202. *
  203. *
  204. * <p>
  205. * Objects of the following type(s) are allowed in the list
  206. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  207. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  208. * {@link JAXBElement }{@code <}{@link Tbl }{@code >}
  209. * {@link CommentRangeStart }
  210. * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >}
  211. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  212. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  213. * {@link RunIns }
  214. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  215. * {@link P }
  216. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  217. * {@link JAXBElement }{@code <}{@link CTOMath }{@code >}
  218. * {@link JAXBElement }{@code <}{@link CTAltChunk }{@code >}
  219. * {@link SdtBlock }
  220. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  221. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  222. * {@link CommentRangeEnd }
  223. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  224. * {@link ProofErr }
  225. * {@link RunDel }
  226. * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >}
  227. * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >}
  228. * {@link JAXBElement }{@code <}{@link CTCustomXmlBlock }{@code >}
  229. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  230. * {@link JAXBElement }{@code <}{@link CTPerm }{@code >}
  231. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  232. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  233. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  234. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  235. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  236. *
  237. *
  238. */
  239. public List<Object> getEGBlockLevelElts() {
  240. if (egBlockLevelElts == null) {
  241. egBlockLevelElts = new ArrayList<Object>();
  242. }
  243. return this.egBlockLevelElts;
  244. }
  245. /**
  246. * Gets the value of the initials property.
  247. *
  248. * @return
  249. * possible object is
  250. * {@link String }
  251. *
  252. */
  253. public String getInitials() {
  254. return initials;
  255. }
  256. /**
  257. * Sets the value of the initials property.
  258. *
  259. * @param value
  260. * allowed object is
  261. * {@link String }
  262. *
  263. */
  264. public void setInitials(String value) {
  265. this.initials = value;
  266. }
  267. /**
  268. * Gets the parent object in the object tree representing the unmarshalled xml document.
  269. *
  270. * @return
  271. * The parent object.
  272. */
  273. public Object getParent() {
  274. return this.parent;
  275. }
  276. public void setParent(Object parent) {
  277. this.parent = parent;
  278. }
  279. /**
  280. * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
  281. *
  282. * @param parent
  283. * The parent object in the object tree.
  284. * @param unmarshaller
  285. * The unmarshaller that generated the instance.
  286. */
  287. public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
  288. setParent(parent);
  289. }
  290. }
  291. }