| 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.math; |
|---|
| 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.XmlElementRef; |
|---|
| 31 | import javax.xml.bind.annotation.XmlElementRefs; |
|---|
| 32 | import javax.xml.bind.annotation.XmlTransient; |
|---|
| 33 | import javax.xml.bind.annotation.XmlType; |
|---|
| 34 | import org.docx4j.wml.CTBookmark; |
|---|
| 35 | import org.docx4j.wml.CTMarkup; |
|---|
| 36 | import org.docx4j.wml.CTMarkupRange; |
|---|
| 37 | import org.docx4j.wml.CTMoveBookmark; |
|---|
| 38 | import org.docx4j.wml.CTPerm; |
|---|
| 39 | import org.docx4j.wml.CTTrackChange; |
|---|
| 40 | import org.docx4j.wml.CommentRangeEnd; |
|---|
| 41 | import org.docx4j.wml.CommentRangeStart; |
|---|
| 42 | import org.docx4j.wml.ProofErr; |
|---|
| 43 | import org.docx4j.wml.RangePermissionStart; |
|---|
| 44 | import org.docx4j.wml.RunDel; |
|---|
| 45 | import org.docx4j.wml.RunIns; |
|---|
| 46 | import org.docx4j.wml.RunTrackChange; |
|---|
| 47 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | /** |
|---|
| 51 | * <p>Java class for CT_OMathArg complex type. |
|---|
| 52 | * |
|---|
| 53 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 54 | * |
|---|
| 55 | * <pre> |
|---|
| 56 | * <complexType name="CT_OMathArg"> |
|---|
| 57 | * <complexContent> |
|---|
| 58 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 59 | * <sequence> |
|---|
| 60 | * <element name="argPr" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_OMathArgPr" minOccurs="0"/> |
|---|
| 61 | * <group ref="{http://schemas.openxmlformats.org/officeDocument/2006/math}EG_OMathElements" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 62 | * <element name="ctrlPr" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_CtrlPr" minOccurs="0"/> |
|---|
| 63 | * </sequence> |
|---|
| 64 | * </restriction> |
|---|
| 65 | * </complexContent> |
|---|
| 66 | * </complexType> |
|---|
| 67 | * </pre> |
|---|
| 68 | * |
|---|
| 69 | * |
|---|
| 70 | */ |
|---|
| 71 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 72 | @XmlType(name = "CT_OMathArg", propOrder = { |
|---|
| 73 | "argPr", |
|---|
| 74 | "egoMathElements", |
|---|
| 75 | "ctrlPr" |
|---|
| 76 | }) |
|---|
| 77 | public class CTOMathArg |
|---|
| 78 | implements Child |
|---|
| 79 | { |
|---|
| 80 | |
|---|
| 81 | protected CTOMathArgPr argPr; |
|---|
| 82 | @XmlElementRefs({ |
|---|
| 83 | @XmlElementRef(name = "customXmlInsRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 84 | @XmlElementRef(name = "nary", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 85 | @XmlElementRef(name = "limLow", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 86 | @XmlElementRef(name = "d", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 87 | @XmlElementRef(name = "bookmarkEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 88 | @XmlElementRef(name = "moveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 89 | @XmlElementRef(name = "commentRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeStart.class), |
|---|
| 90 | @XmlElementRef(name = "r", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 91 | @XmlElementRef(name = "eqArr", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 92 | @XmlElementRef(name = "permStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 93 | @XmlElementRef(name = "customXmlMoveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 94 | @XmlElementRef(name = "f", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 95 | @XmlElementRef(name = "ins", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunIns.class), |
|---|
| 96 | @XmlElementRef(name = "borderBox", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 97 | @XmlElementRef(name = "moveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 98 | @XmlElementRef(name = "customXmlInsRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 99 | @XmlElementRef(name = "sSubSup", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 100 | @XmlElementRef(name = "sSup", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 101 | @XmlElementRef(name = "oMath", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 102 | @XmlElementRef(name = "func", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 103 | @XmlElementRef(name = "limUpp", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 104 | @XmlElementRef(name = "moveTo", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 105 | @XmlElementRef(name = "customXmlMoveToRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 106 | @XmlElementRef(name = "customXmlDelRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 107 | @XmlElementRef(name = "bookmarkStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 108 | @XmlElementRef(name = "customXmlMoveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 109 | @XmlElementRef(name = "moveToRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 110 | @XmlElementRef(name = "commentRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = CommentRangeEnd.class), |
|---|
| 111 | @XmlElementRef(name = "sPre", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 112 | @XmlElementRef(name = "moveFromRangeStart", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 113 | @XmlElementRef(name = "m", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 114 | @XmlElementRef(name = "box", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 115 | @XmlElementRef(name = "bar", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 116 | @XmlElementRef(name = "proofErr", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = ProofErr.class), |
|---|
| 117 | @XmlElementRef(name = "del", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = RunDel.class), |
|---|
| 118 | @XmlElementRef(name = "groupChr", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 119 | @XmlElementRef(name = "sSub", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 120 | @XmlElementRef(name = "oMathPara", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 121 | @XmlElementRef(name = "acc", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 122 | @XmlElementRef(name = "customXmlMoveFromRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 123 | @XmlElementRef(name = "moveFrom", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 124 | @XmlElementRef(name = "rad", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 125 | @XmlElementRef(name = "phant", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", type = JAXBElement.class), |
|---|
| 126 | @XmlElementRef(name = "permEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 127 | @XmlElementRef(name = "customXmlDelRangeEnd", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class) |
|---|
| 128 | }) |
|---|
| 129 | protected List<Object> egoMathElements; |
|---|
| 130 | protected CTCtrlPr ctrlPr; |
|---|
| 131 | @XmlTransient |
|---|
| 132 | private Object parent; |
|---|
| 133 | |
|---|
| 134 | /** |
|---|
| 135 | * Gets the value of the argPr property. |
|---|
| 136 | * |
|---|
| 137 | * @return |
|---|
| 138 | * possible object is |
|---|
| 139 | * {@link CTOMathArgPr } |
|---|
| 140 | * |
|---|
| 141 | */ |
|---|
| 142 | public CTOMathArgPr getArgPr() { |
|---|
| 143 | return argPr; |
|---|
| 144 | } |
|---|
| 145 | |
|---|
| 146 | /** |
|---|
| 147 | * Sets the value of the argPr property. |
|---|
| 148 | * |
|---|
| 149 | * @param value |
|---|
| 150 | * allowed object is |
|---|
| 151 | * {@link CTOMathArgPr } |
|---|
| 152 | * |
|---|
| 153 | */ |
|---|
| 154 | public void setArgPr(CTOMathArgPr value) { |
|---|
| 155 | this.argPr = value; |
|---|
| 156 | } |
|---|
| 157 | |
|---|
| 158 | /** |
|---|
| 159 | * Gets the value of the egoMathElements property. |
|---|
| 160 | * |
|---|
| 161 | * <p> |
|---|
| 162 | * This accessor method returns a reference to the live list, |
|---|
| 163 | * not a snapshot. Therefore any modification you make to the |
|---|
| 164 | * returned list will be present inside the JAXB object. |
|---|
| 165 | * This is why there is not a <CODE>set</CODE> method for the egoMathElements property. |
|---|
| 166 | * |
|---|
| 167 | * <p> |
|---|
| 168 | * For example, to add a new item, do as follows: |
|---|
| 169 | * <pre> |
|---|
| 170 | * getEGOMathElements().add(newItem); |
|---|
| 171 | * </pre> |
|---|
| 172 | * |
|---|
| 173 | * |
|---|
| 174 | * <p> |
|---|
| 175 | * Objects of the following type(s) are allowed in the list |
|---|
| 176 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 177 | * {@link JAXBElement }{@code <}{@link CTNary }{@code >} |
|---|
| 178 | * {@link JAXBElement }{@code <}{@link CTLimLow }{@code >} |
|---|
| 179 | * {@link JAXBElement }{@code <}{@link CTD }{@code >} |
|---|
| 180 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 181 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 182 | * {@link JAXBElement }{@code <}{@link CTEqArr }{@code >} |
|---|
| 183 | * {@link JAXBElement }{@code <}{@link CTR }{@code >} |
|---|
| 184 | * {@link CommentRangeStart } |
|---|
| 185 | * {@link JAXBElement }{@code <}{@link RangePermissionStart }{@code >} |
|---|
| 186 | * {@link JAXBElement }{@code <}{@link CTF }{@code >} |
|---|
| 187 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 188 | * {@link JAXBElement }{@code <}{@link CTBorderBox }{@code >} |
|---|
| 189 | * {@link RunIns } |
|---|
| 190 | * {@link JAXBElement }{@code <}{@link CTMarkupRange }{@code >} |
|---|
| 191 | * {@link JAXBElement }{@code <}{@link CTSSubSup }{@code >} |
|---|
| 192 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 193 | * {@link JAXBElement }{@code <}{@link CTSSup }{@code >} |
|---|
| 194 | * {@link JAXBElement }{@code <}{@link CTOMath }{@code >} |
|---|
| 195 | * {@link JAXBElement }{@code <}{@link CTFunc }{@code >} |
|---|
| 196 | * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >} |
|---|
| 197 | * {@link JAXBElement }{@code <}{@link CTLimUpp }{@code >} |
|---|
| 198 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 199 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 200 | * {@link JAXBElement }{@code <}{@link CTBookmark }{@code >} |
|---|
| 201 | * {@link JAXBElement }{@code <}{@link CTTrackChange }{@code >} |
|---|
| 202 | * {@link CommentRangeEnd } |
|---|
| 203 | * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >} |
|---|
| 204 | * {@link JAXBElement }{@code <}{@link CTSPre }{@code >} |
|---|
| 205 | * {@link JAXBElement }{@code <}{@link CTMoveBookmark }{@code >} |
|---|
| 206 | * {@link JAXBElement }{@code <}{@link CTM }{@code >} |
|---|
| 207 | * {@link JAXBElement }{@code <}{@link CTBar }{@code >} |
|---|
| 208 | * {@link JAXBElement }{@code <}{@link CTBox }{@code >} |
|---|
| 209 | * {@link ProofErr } |
|---|
| 210 | * {@link JAXBElement }{@code <}{@link CTGroupChr }{@code >} |
|---|
| 211 | * {@link RunDel } |
|---|
| 212 | * {@link JAXBElement }{@code <}{@link CTSSub }{@code >} |
|---|
| 213 | * {@link JAXBElement }{@code <}{@link CTOMathPara }{@code >} |
|---|
| 214 | * {@link JAXBElement }{@code <}{@link CTAcc }{@code >} |
|---|
| 215 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 216 | * {@link JAXBElement }{@code <}{@link RunTrackChange }{@code >} |
|---|
| 217 | * {@link JAXBElement }{@code <}{@link CTRad }{@code >} |
|---|
| 218 | * {@link JAXBElement }{@code <}{@link CTPerm }{@code >} |
|---|
| 219 | * {@link JAXBElement }{@code <}{@link CTPhant }{@code >} |
|---|
| 220 | * {@link JAXBElement }{@code <}{@link CTMarkup }{@code >} |
|---|
| 221 | * |
|---|
| 222 | * |
|---|
| 223 | */ |
|---|
| 224 | public List<Object> getEGOMathElements() { |
|---|
| 225 | if (egoMathElements == null) { |
|---|
| 226 | egoMathElements = new ArrayList<Object>(); |
|---|
| 227 | } |
|---|
| 228 | return this.egoMathElements; |
|---|
| 229 | } |
|---|
| 230 | |
|---|
| 231 | /** |
|---|
| 232 | * Gets the value of the ctrlPr property. |
|---|
| 233 | * |
|---|
| 234 | * @return |
|---|
| 235 | * possible object is |
|---|
| 236 | * {@link CTCtrlPr } |
|---|
| 237 | * |
|---|
| 238 | */ |
|---|
| 239 | public CTCtrlPr getCtrlPr() { |
|---|
| 240 | return ctrlPr; |
|---|
| 241 | } |
|---|
| 242 | |
|---|
| 243 | /** |
|---|
| 244 | * Sets the value of the ctrlPr property. |
|---|
| 245 | * |
|---|
| 246 | * @param value |
|---|
| 247 | * allowed object is |
|---|
| 248 | * {@link CTCtrlPr } |
|---|
| 249 | * |
|---|
| 250 | */ |
|---|
| 251 | public void setCtrlPr(CTCtrlPr value) { |
|---|
| 252 | this.ctrlPr = value; |
|---|
| 253 | } |
|---|
| 254 | |
|---|
| 255 | /** |
|---|
| 256 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 257 | * |
|---|
| 258 | * @return |
|---|
| 259 | * The parent object. |
|---|
| 260 | */ |
|---|
| 261 | public Object getParent() { |
|---|
| 262 | return this.parent; |
|---|
| 263 | } |
|---|
| 264 | |
|---|
| 265 | public void setParent(Object parent) { |
|---|
| 266 | this.parent = parent; |
|---|
| 267 | } |
|---|
| 268 | |
|---|
| 269 | /** |
|---|
| 270 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 271 | * |
|---|
| 272 | * @param parent |
|---|
| 273 | * The parent object in the object tree. |
|---|
| 274 | * @param unmarshaller |
|---|
| 275 | * The unmarshaller that generated the instance. |
|---|
| 276 | */ |
|---|
| 277 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 278 | setParent(parent); |
|---|
| 279 | } |
|---|
| 280 | |
|---|
| 281 | } |
|---|