| 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.wml; |
|---|
| 23 | |
|---|
| 24 | import java.util.ArrayList; |
|---|
| 25 | import java.util.List; |
|---|
| 26 | import javax.xml.bind.Unmarshaller; |
|---|
| 27 | import javax.xml.bind.annotation.XmlAccessType; |
|---|
| 28 | import javax.xml.bind.annotation.XmlAccessorType; |
|---|
| 29 | import javax.xml.bind.annotation.XmlAttribute; |
|---|
| 30 | import javax.xml.bind.annotation.XmlElement; |
|---|
| 31 | import javax.xml.bind.annotation.XmlElements; |
|---|
| 32 | import javax.xml.bind.annotation.XmlTransient; |
|---|
| 33 | import javax.xml.bind.annotation.XmlType; |
|---|
| 34 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * <p>Java class for CT_Frameset complex type. |
|---|
| 39 | * |
|---|
| 40 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 41 | * |
|---|
| 42 | * <pre> |
|---|
| 43 | * <complexType name="CT_Frameset"> |
|---|
| 44 | * <complexContent> |
|---|
| 45 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 46 | * <sequence> |
|---|
| 47 | * <element name="sz" minOccurs="0"> |
|---|
| 48 | * <complexType> |
|---|
| 49 | * <complexContent> |
|---|
| 50 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 51 | * <attribute name="val" type="{http://www.w3.org/2001/XMLSchema}string" /> |
|---|
| 52 | * </restriction> |
|---|
| 53 | * </complexContent> |
|---|
| 54 | * </complexType> |
|---|
| 55 | * </element> |
|---|
| 56 | * <element name="framesetSplitbar" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FramesetSplitbar" minOccurs="0"/> |
|---|
| 57 | * <element name="frameLayout" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FrameLayout" minOccurs="0"/> |
|---|
| 58 | * <choice maxOccurs="unbounded" minOccurs="0"> |
|---|
| 59 | * <element name="frameset" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_Frameset" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 60 | * <element name="frame" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_Frame" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 61 | * </choice> |
|---|
| 62 | * </sequence> |
|---|
| 63 | * </restriction> |
|---|
| 64 | * </complexContent> |
|---|
| 65 | * </complexType> |
|---|
| 66 | * </pre> |
|---|
| 67 | * |
|---|
| 68 | * |
|---|
| 69 | */ |
|---|
| 70 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 71 | @XmlType(name = "CT_Frameset", propOrder = { |
|---|
| 72 | "sz", |
|---|
| 73 | "framesetSplitbar", |
|---|
| 74 | "frameLayout", |
|---|
| 75 | "framesetOrFrame" |
|---|
| 76 | }) |
|---|
| 77 | public class CTFrameset implements Child |
|---|
| 78 | { |
|---|
| 79 | |
|---|
| 80 | protected CTFrameset.Sz sz; |
|---|
| 81 | protected CTFramesetSplitbar framesetSplitbar; |
|---|
| 82 | protected CTFrameLayout frameLayout; |
|---|
| 83 | @XmlElements({ |
|---|
| 84 | @XmlElement(name = "frameset", type = CTFrameset.class), |
|---|
| 85 | @XmlElement(name = "frame", type = CTFrame.class) |
|---|
| 86 | }) |
|---|
| 87 | protected List<Object> framesetOrFrame; |
|---|
| 88 | @XmlTransient |
|---|
| 89 | private Object parent; |
|---|
| 90 | |
|---|
| 91 | /** |
|---|
| 92 | * Gets the value of the sz property. |
|---|
| 93 | * |
|---|
| 94 | * @return |
|---|
| 95 | * possible object is |
|---|
| 96 | * {@link CTFrameset.Sz } |
|---|
| 97 | * |
|---|
| 98 | */ |
|---|
| 99 | public CTFrameset.Sz getSz() { |
|---|
| 100 | return sz; |
|---|
| 101 | } |
|---|
| 102 | |
|---|
| 103 | /** |
|---|
| 104 | * Sets the value of the sz property. |
|---|
| 105 | * |
|---|
| 106 | * @param value |
|---|
| 107 | * allowed object is |
|---|
| 108 | * {@link CTFrameset.Sz } |
|---|
| 109 | * |
|---|
| 110 | */ |
|---|
| 111 | public void setSz(CTFrameset.Sz value) { |
|---|
| 112 | this.sz = value; |
|---|
| 113 | } |
|---|
| 114 | |
|---|
| 115 | /** |
|---|
| 116 | * Gets the value of the framesetSplitbar property. |
|---|
| 117 | * |
|---|
| 118 | * @return |
|---|
| 119 | * possible object is |
|---|
| 120 | * {@link CTFramesetSplitbar } |
|---|
| 121 | * |
|---|
| 122 | */ |
|---|
| 123 | public CTFramesetSplitbar getFramesetSplitbar() { |
|---|
| 124 | return framesetSplitbar; |
|---|
| 125 | } |
|---|
| 126 | |
|---|
| 127 | /** |
|---|
| 128 | * Sets the value of the framesetSplitbar property. |
|---|
| 129 | * |
|---|
| 130 | * @param value |
|---|
| 131 | * allowed object is |
|---|
| 132 | * {@link CTFramesetSplitbar } |
|---|
| 133 | * |
|---|
| 134 | */ |
|---|
| 135 | public void setFramesetSplitbar(CTFramesetSplitbar value) { |
|---|
| 136 | this.framesetSplitbar = value; |
|---|
| 137 | } |
|---|
| 138 | |
|---|
| 139 | /** |
|---|
| 140 | * Gets the value of the frameLayout property. |
|---|
| 141 | * |
|---|
| 142 | * @return |
|---|
| 143 | * possible object is |
|---|
| 144 | * {@link CTFrameLayout } |
|---|
| 145 | * |
|---|
| 146 | */ |
|---|
| 147 | public CTFrameLayout getFrameLayout() { |
|---|
| 148 | return frameLayout; |
|---|
| 149 | } |
|---|
| 150 | |
|---|
| 151 | /** |
|---|
| 152 | * Sets the value of the frameLayout property. |
|---|
| 153 | * |
|---|
| 154 | * @param value |
|---|
| 155 | * allowed object is |
|---|
| 156 | * {@link CTFrameLayout } |
|---|
| 157 | * |
|---|
| 158 | */ |
|---|
| 159 | public void setFrameLayout(CTFrameLayout value) { |
|---|
| 160 | this.frameLayout = value; |
|---|
| 161 | } |
|---|
| 162 | |
|---|
| 163 | /** |
|---|
| 164 | * Gets the value of the framesetOrFrame property. |
|---|
| 165 | * |
|---|
| 166 | * <p> |
|---|
| 167 | * This accessor method returns a reference to the live list, |
|---|
| 168 | * not a snapshot. Therefore any modification you make to the |
|---|
| 169 | * returned list will be present inside the JAXB object. |
|---|
| 170 | * This is why there is not a <CODE>set</CODE> method for the framesetOrFrame property. |
|---|
| 171 | * |
|---|
| 172 | * <p> |
|---|
| 173 | * For example, to add a new item, do as follows: |
|---|
| 174 | * <pre> |
|---|
| 175 | * getFramesetOrFrame().add(newItem); |
|---|
| 176 | * </pre> |
|---|
| 177 | * |
|---|
| 178 | * |
|---|
| 179 | * <p> |
|---|
| 180 | * Objects of the following type(s) are allowed in the list |
|---|
| 181 | * {@link CTFrameset } |
|---|
| 182 | * {@link CTFrame } |
|---|
| 183 | * |
|---|
| 184 | * |
|---|
| 185 | */ |
|---|
| 186 | public List<Object> getFramesetOrFrame() { |
|---|
| 187 | if (framesetOrFrame == null) { |
|---|
| 188 | framesetOrFrame = new ArrayList<Object>(); |
|---|
| 189 | } |
|---|
| 190 | return this.framesetOrFrame; |
|---|
| 191 | } |
|---|
| 192 | |
|---|
| 193 | /** |
|---|
| 194 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 195 | * |
|---|
| 196 | * @return |
|---|
| 197 | * The parent object. |
|---|
| 198 | */ |
|---|
| 199 | public Object getParent() { |
|---|
| 200 | return this.parent; |
|---|
| 201 | } |
|---|
| 202 | |
|---|
| 203 | public void setParent(Object parent) { |
|---|
| 204 | this.parent = parent; |
|---|
| 205 | } |
|---|
| 206 | |
|---|
| 207 | /** |
|---|
| 208 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 209 | * |
|---|
| 210 | * @param parent |
|---|
| 211 | * The parent object in the object tree. |
|---|
| 212 | * @param unmarshaller |
|---|
| 213 | * The unmarshaller that generated the instance. |
|---|
| 214 | */ |
|---|
| 215 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 216 | setParent(parent); |
|---|
| 217 | } |
|---|
| 218 | |
|---|
| 219 | |
|---|
| 220 | /** |
|---|
| 221 | * <p>Java class for anonymous complex type. |
|---|
| 222 | * |
|---|
| 223 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 224 | * |
|---|
| 225 | * <pre> |
|---|
| 226 | * <complexType> |
|---|
| 227 | * <complexContent> |
|---|
| 228 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 229 | * <attribute name="val" type="{http://www.w3.org/2001/XMLSchema}string" /> |
|---|
| 230 | * </restriction> |
|---|
| 231 | * </complexContent> |
|---|
| 232 | * </complexType> |
|---|
| 233 | * </pre> |
|---|
| 234 | * |
|---|
| 235 | * |
|---|
| 236 | */ |
|---|
| 237 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 238 | @XmlType(name = "") |
|---|
| 239 | public static class Sz |
|---|
| 240 | implements Child |
|---|
| 241 | { |
|---|
| 242 | |
|---|
| 243 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main") |
|---|
| 244 | protected String val; |
|---|
| 245 | @XmlTransient |
|---|
| 246 | private Object parent; |
|---|
| 247 | |
|---|
| 248 | /** |
|---|
| 249 | * Gets the value of the val property. |
|---|
| 250 | * |
|---|
| 251 | * @return |
|---|
| 252 | * possible object is |
|---|
| 253 | * {@link String } |
|---|
| 254 | * |
|---|
| 255 | */ |
|---|
| 256 | public String getVal() { |
|---|
| 257 | return val; |
|---|
| 258 | } |
|---|
| 259 | |
|---|
| 260 | /** |
|---|
| 261 | * Sets the value of the val property. |
|---|
| 262 | * |
|---|
| 263 | * @param value |
|---|
| 264 | * allowed object is |
|---|
| 265 | * {@link String } |
|---|
| 266 | * |
|---|
| 267 | */ |
|---|
| 268 | public void setVal(String value) { |
|---|
| 269 | this.val = value; |
|---|
| 270 | } |
|---|
| 271 | |
|---|
| 272 | /** |
|---|
| 273 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 274 | * |
|---|
| 275 | * @return |
|---|
| 276 | * The parent object. |
|---|
| 277 | */ |
|---|
| 278 | public Object getParent() { |
|---|
| 279 | return this.parent; |
|---|
| 280 | } |
|---|
| 281 | |
|---|
| 282 | public void setParent(Object parent) { |
|---|
| 283 | this.parent = parent; |
|---|
| 284 | } |
|---|
| 285 | |
|---|
| 286 | /** |
|---|
| 287 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 288 | * |
|---|
| 289 | * @param parent |
|---|
| 290 | * The parent object in the object tree. |
|---|
| 291 | * @param unmarshaller |
|---|
| 292 | * The unmarshaller that generated the instance. |
|---|
| 293 | */ |
|---|
| 294 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 295 | setParent(parent); |
|---|
| 296 | } |
|---|
| 297 | |
|---|
| 298 | } |
|---|
| 299 | |
|---|
| 300 | } |
|---|