PageRenderTime 42ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/docx4j-openxml-objects/src/main/java/org/docx4j/wml/CTCustomXmlBlock.java

http://github.com/plutext/docx4j
Java | 272 lines | 98 code | 21 blank | 153 comment | 2 complexity | b4f945963e37d7f733f7246c201a6a7f MD5 | raw file
Possible License(s): Apache-2.0
  1. /*
  2. * Copyright 2007-2013, 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.XmlTransient;
  26. import javax.xml.bind.annotation.XmlType;
  27. import org.docx4j.math.CTOMath;
  28. import org.docx4j.math.CTOMathPara;
  29. /**
  30. * <p>Java class for CT_CustomXmlBlock complex type.
  31. *
  32. * <p>The following schema fragment specifies the expected content contained within this class.
  33. *
  34. * <pre>
  35. * &lt;complexType name="CT_CustomXmlBlock">
  36. * &lt;complexContent>
  37. * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  38. * &lt;sequence>
  39. * &lt;element name="customXmlPr" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_CustomXmlPr" minOccurs="0"/>
  40. * &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_ContentBlockContent" maxOccurs="unbounded" minOccurs="0"/>
  41. * &lt;/sequence>
  42. * &lt;attribute name="uri" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
  43. * &lt;attribute name="element" use="required" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_String" />
  44. * &lt;/restriction>
  45. * &lt;/complexContent>
  46. * &lt;/complexType>
  47. * </pre>
  48. *
  49. *
  50. */
  51. @XmlAccessorType(XmlAccessType.FIELD)
  52. @XmlType(name = "CT_CustomXmlBlock", propOrder = {
  53. "customXmlPr",
  54. "content"
  55. })
  56. public class CTCustomXmlBlock implements CTCustomXmlElement
  57. {
  58. protected CTCustomXmlPr customXmlPr;
  59. @XmlElementRefs({
  60. @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  61. @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  62. @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class),
  63. @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  64. @XmlElementRef(name = "p", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = P.class),
  65. @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  66. @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  67. @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  68. @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  69. @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  70. @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class),
  71. @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class),
  72. @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  73. @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class),
  74. @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  75. @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = SdtBlock.class),
  76. @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  77. @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  78. @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  79. @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  80. @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  81. @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  82. @XmlElementRef(name = "tbl", 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 = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  85. @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  86. @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  87. @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  88. @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class)
  89. })
  90. protected List<Object> content = new ArrayListWml<Object>(this);
  91. @XmlAttribute(name = "uri", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")
  92. protected String uri;
  93. @XmlAttribute(name = "element", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", required = true)
  94. protected String element;
  95. @XmlTransient
  96. private Object parent;
  97. /**
  98. * Gets the value of the customXmlPr property.
  99. *
  100. * @return
  101. * possible object is
  102. * {@link CTCustomXmlPr }
  103. *
  104. */
  105. public CTCustomXmlPr getCustomXmlPr() {
  106. return customXmlPr;
  107. }
  108. /**
  109. * Sets the value of the customXmlPr property.
  110. *
  111. * @param value
  112. * allowed object is
  113. * {@link CTCustomXmlPr }
  114. *
  115. */
  116. public void setCustomXmlPr(CTCustomXmlPr value) {
  117. this.customXmlPr = value;
  118. }
  119. /**
  120. * Gets the value of the content property.
  121. *
  122. * <p>
  123. * This accessor method returns a reference to the live list,
  124. * not a snapshot. Therefore any modification you make to the
  125. * returned list will be present inside the JAXB object.
  126. * This is why there is not a <CODE>set</CODE> method for the content property.
  127. *
  128. * <p>
  129. * For example, to add a new item, do as follows:
  130. * <pre>
  131. * getContent().add(newItem);
  132. * </pre>
  133. *
  134. *
  135. * <p>
  136. * Objects of the following type(s) are allowed in the list
  137. * {@link JAXBElement }{@code <}{@link CTMoveFromRangeEnd }{@code >}
  138. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  139. * {@link RunIns }
  140. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  141. * {@link P }
  142. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  143. * {@link JAXBElement }{@code <}{@link CTPerm }{@code >}
  144. * {@link JAXBElement }{@code <}{@link CTMoveToRangeEnd }{@code >}
  145. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  146. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  147. * {@link ProofErr }
  148. * {@link CommentRangeEnd }
  149. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  150. * {@link RunDel }
  151. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  152. * {@link SdtBlock }
  153. * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >}
  154. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  155. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  156. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  157. * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >}
  158. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  159. * {@link JAXBElement }{@code <}{@link Tbl }{@code >}
  160. * {@link CommentRangeStart }
  161. * {@link JAXBElement }{@code <}{@link CTCustomXmlBlock }{@code >}
  162. * {@link JAXBElement }{@code <}{@link CTOMath }{@code >}
  163. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  164. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  165. * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >}
  166. *
  167. * @since 2.7
  168. */
  169. public List<Object> getContent() {
  170. if (content == null) {
  171. content = new ArrayListWml<Object>(this);
  172. }
  173. return this.content;
  174. }
  175. @Deprecated
  176. public List<Object> getEGContentBlockContent() {
  177. return getContent();
  178. }
  179. /**
  180. * Gets the value of the uri property.
  181. *
  182. * @return
  183. * possible object is
  184. * {@link String }
  185. *
  186. */
  187. public String getUri() {
  188. return uri;
  189. }
  190. /**
  191. * Sets the value of the uri property.
  192. *
  193. * @param value
  194. * allowed object is
  195. * {@link String }
  196. *
  197. */
  198. public void setUri(String value) {
  199. this.uri = value;
  200. }
  201. /**
  202. * Gets the value of the element property.
  203. *
  204. * @return
  205. * possible object is
  206. * {@link String }
  207. *
  208. */
  209. public String getElement() {
  210. return element;
  211. }
  212. /**
  213. * Sets the value of the element property.
  214. *
  215. * @param value
  216. * allowed object is
  217. * {@link String }
  218. *
  219. */
  220. public void setElement(String value) {
  221. this.element = value;
  222. }
  223. /**
  224. * Gets the parent object in the object tree representing the unmarshalled xml document.
  225. *
  226. * @return
  227. * The parent object.
  228. */
  229. public Object getParent() {
  230. return this.parent;
  231. }
  232. public void setParent(Object parent) {
  233. this.parent = parent;
  234. }
  235. /**
  236. * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
  237. *
  238. * @param parent
  239. * The parent object in the object tree.
  240. * @param unmarshaller
  241. * The unmarshaller that generated the instance.
  242. */
  243. public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
  244. setParent(parent);
  245. }
  246. }