PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/plutext/docx4j
Java | 202 lines | 81 code | 14 blank | 107 comment | 4 complexity | 35eab5ec8f98dd971f63c92a4cd13559 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. * Header
  32. *
  33. * <p>Java class for anonymous complex type.
  34. *
  35. * <p>The following schema fragment specifies the expected content contained within this class.
  36. *
  37. * <pre>
  38. * &lt;complexType>
  39. * &lt;complexContent>
  40. * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  41. * &lt;group ref="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}EG_BlockLevelElts" maxOccurs="unbounded"/>
  42. * &lt;/restriction>
  43. * &lt;/complexContent>
  44. * &lt;/complexType>
  45. * </pre>
  46. *
  47. *
  48. */
  49. @XmlAccessorType(XmlAccessType.FIELD)
  50. @XmlType(name = "", propOrder = {
  51. "egBlockLevelElts"
  52. })
  53. @XmlRootElement(name = "hdr")
  54. public class Hdr
  55. implements Child, ContentAccessor
  56. {
  57. @XmlElementRefs({
  58. @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  59. @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  60. @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  61. @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  62. @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class),
  63. @XmlElementRef(name = "altChunk", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  64. @XmlElementRef(name = "tbl", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  65. @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class),
  66. @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  67. @XmlElementRef(name = "p", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = P.class),
  68. @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  69. @XmlElementRef(name = "customXml", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  70. @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  71. @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  72. @XmlElementRef(name = "sdt", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = SdtBlock.class),
  73. @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  74. @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  75. @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  76. @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  77. @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class),
  78. @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  79. @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class),
  80. @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class),
  81. @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  82. @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  83. @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class),
  84. @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class),
  85. @XmlElementRef(name = "moveToRangeEnd", 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 = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class)
  88. })
  89. protected List<Object> egBlockLevelElts;
  90. @XmlTransient
  91. private Object parent;
  92. /**
  93. * Gets the value of the egBlockLevelElts 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 egBlockLevelElts property.
  100. *
  101. * <p>
  102. * For example, to add a new item, do as follows:
  103. * <pre>
  104. * getEGBlockLevelElts().add(newItem);
  105. * </pre>
  106. *
  107. *
  108. * <p>
  109. * Objects of the following type(s) are allowed in the list
  110. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  111. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  112. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  113. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  114. * {@link CommentRangeStart }
  115. * {@link JAXBElement }{@code <}{@link CTAltChunk }{@code >}
  116. * {@link JAXBElement }{@code <}{@link Tbl }{@code >}
  117. * {@link RunIns }
  118. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  119. * {@link P }
  120. * {@link JAXBElement }{@code <}{@link CTOMath }{@code >}
  121. * {@link JAXBElement }{@code <}{@link CTCustomXmlBlock }{@code >}
  122. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  123. * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >}
  124. * {@link SdtBlock }
  125. * {@link JAXBElement }{@code <}{@link CTPerm }{@code >}
  126. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  127. * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >}
  128. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  129. * {@link CommentRangeEnd }
  130. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  131. * {@link ProofErr }
  132. * {@link RunDel }
  133. * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >}
  134. * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >}
  135. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  136. * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >}
  137. * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >}
  138. * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >}
  139. * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >}
  140. *
  141. *
  142. */
  143. @Deprecated
  144. public List<Object> getEGBlockLevelElts() {
  145. if (egBlockLevelElts == null) {
  146. egBlockLevelElts = new ArrayList<Object>();
  147. }
  148. return this.egBlockLevelElts;
  149. }
  150. /**
  151. * Get the content of this element.
  152. * @since 2.7
  153. */
  154. public List<Object> getContent() {
  155. if (egBlockLevelElts == null) {
  156. egBlockLevelElts = new ArrayList<Object>();
  157. }
  158. return this.egBlockLevelElts;
  159. }
  160. /**
  161. * Gets the parent object in the object tree representing the unmarshalled xml document.
  162. *
  163. * @return
  164. * The parent object.
  165. */
  166. public Object getParent() {
  167. return this.parent;
  168. }
  169. public void setParent(Object parent) {
  170. this.parent = parent;
  171. }
  172. /**
  173. * This method is invoked by the JAXB implementation on each instance when unmarshalling completes.
  174. *
  175. * @param parent
  176. * The parent object in the object tree.
  177. * @param unmarshaller
  178. * The unmarshaller that generated the instance.
  179. */
  180. public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
  181. setParent(parent);
  182. }
  183. }