PageRenderTime 51ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/plutext/docx4j
Java | 202 lines | 83 code | 12 blank | 107 comment | 4 complexity | 8d85a608dadcb03a8cc46b5b0f78ece0 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.XmlElementRef;
  23. import javax.xml.bind.annotation.XmlElementRefs;
  24. import javax.xml.bind.annotation.XmlRootElement;
  25. import javax.xml.bind.annotation.XmlTransient;
  26. import javax.xml.bind.annotation.XmlType;
  27. import org.docx4j.math.CTOMath;
  28. import org.docx4j.math.CTOMathPara;
  29. import org.jvnet.jaxb2_commons.ppp.Child;
  30. /**
  31. * <p>Java class for CT_SdtContentRun complex type.
  32. *
  33. * <p>The following schema fragment specifies the expected content contained within this class.
  34. *
  35. * <pre>
  36. * &lt;complexType name="CT_SdtContentRun">
  37. * &lt;complexContent>
  38. * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  39. * &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_PContent" maxOccurs="unbounded" minOccurs="0"/>
  40. * &lt;/restriction>
  41. * &lt;/complexContent>
  42. * &lt;/complexType>
  43. * </pre>
  44. *
  45. *
  46. */
  47. @XmlAccessorType(XmlAccessType.FIELD)
  48. @XmlType(name = "CT_SdtContentRun", propOrder = {
  49. "paragraphContent"
  50. })
  51. @XmlRootElement(name = "sdtContent")
  52. public class CTSdtContentRun
  53. implements Child, ContentAccessor
  54. {
  55. @XmlElementRefs({
  56. @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class),
  57. @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  58. @XmlElementRef(name = "subDoc", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  59. @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class),
  60. @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  61. @XmlElementRef(name = "r", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = R.class),
  62. @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  63. @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  64. @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  65. @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  66. @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  67. @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  68. @XmlElementRef(name = "hyperlink", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  69. @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class),
  70. @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  71. @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  72. @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  73. @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class),
  74. @XmlElementRef(name = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  75. @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class),
  76. @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  77. @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  78. @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  79. @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  80. @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  81. @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  82. @XmlElementRef(name = "smartTag", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  83. @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  84. @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  85. @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  86. @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  87. @XmlElementRef(name = "fldSimple", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class)
  88. })
  89. protected List<Object> paragraphContent;
  90. @XmlTransient
  91. private Object parent;
  92. /**
  93. * Gets the value of the paragraphContent property.
  94. *
  95. * <p>
  96. * This accessor method returns a reference to the live list,
  97. * not a snapshot. Therefore any modification you make to the
  98. * returned list will be present inside the JAXB object.
  99. * This is why there is not a <CODE>set</CODE> method for the paragraphContent property.
  100. *
  101. * <p>
  102. * For example, to add a new item, do as follows:
  103. * <pre>
  104. * getParagraphContent().add(newItem);
  105. * </pre>
  106. *
  107. *
  108. * <p>
  109. * Objects of the following type(s) are allowed in the list
  110. * {@link CommentRangeStart }
  111. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  112. * {@link JAXBElement }{@code <}{@link CTRel }{@code >}
  113. * {@link RunIns }
  114. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  115. * {@link R }
  116. * {@link JAXBElement }{@code <}{@link CTOMath }{@code >}
  117. * {@link JAXBElement }{@code <}{@link SdtRun }{@code >}
  118. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  119. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  120. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  121. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  122. * {@link JAXBElement }{@code <}{@link org.docx4j.wml.P.Hyperlink }{@code >}
  123. * {@link CommentRangeEnd }
  124. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  125. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  126. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  127. * {@link ProofErr }
  128. * {@link JAXBElement }{@code <}{@link CTCustomXmlRun }{@code >}
  129. * {@link RunDel }
  130. * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >}
  131. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  132. * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >}
  133. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  134. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  135. * {@link JAXBElement }{@code <}{@link CTPerm }{@code >}
  136. * {@link JAXBElement }{@code <}{@link CTSmartTagRun }{@code >}
  137. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  138. * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >}
  139. * {@link JAXBElement }{@code <}{@link CTSimpleField }{@code >}
  140. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  141. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  142. *
  143. *
  144. */
  145. @Deprecated
  146. public List<Object> getParagraphContent() {
  147. if (paragraphContent == null) {
  148. paragraphContent = new ArrayList<Object>();
  149. }
  150. return this.paragraphContent;
  151. }
  152. /**
  153. * Get the content of this element.
  154. * @since 2.7
  155. */
  156. public List<Object> getContent() {
  157. if (paragraphContent == null) {
  158. paragraphContent = new ArrayList<Object>();
  159. }
  160. return this.paragraphContent;
  161. }
  162. /**
  163. * Gets the parent object in the object tree representing the unmarshalled xml document.
  164. *
  165. * @return
  166. * The parent object.
  167. */
  168. public Object getParent() {
  169. return this.parent;
  170. }
  171. public void setParent(Object parent) {
  172. this.parent = parent;
  173. }
  174. /**
  175. * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
  176. *
  177. * @param parent
  178. * The parent object in the object tree.
  179. * @param unmarshaller
  180. * The unmarshaller that generated the instance.
  181. */
  182. public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
  183. setParent(parent);
  184. }
  185. }