| 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.XmlTransient; |
|---|
| 30 | import javax.xml.bind.annotation.XmlType; |
|---|
| 31 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | /** |
|---|
| 35 | * <p>Java class for CT_TblGridBase complex type. |
|---|
| 36 | * |
|---|
| 37 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 38 | * |
|---|
| 39 | * <pre> |
|---|
| 40 | * <complexType name="CT_TblGridBase"> |
|---|
| 41 | * <complexContent> |
|---|
| 42 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 43 | * <sequence> |
|---|
| 44 | * <element name="gridCol" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_TblGridCol" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 45 | * </sequence> |
|---|
| 46 | * </restriction> |
|---|
| 47 | * </complexContent> |
|---|
| 48 | * </complexType> |
|---|
| 49 | * </pre> |
|---|
| 50 | * |
|---|
| 51 | * |
|---|
| 52 | */ |
|---|
| 53 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 54 | @XmlType(name = "CT_TblGridBase", propOrder = { |
|---|
| 55 | "gridCol" |
|---|
| 56 | }) |
|---|
| 57 | public class TblGridBase |
|---|
| 58 | implements Child |
|---|
| 59 | { |
|---|
| 60 | |
|---|
| 61 | protected List<TblGridCol> gridCol; |
|---|
| 62 | @XmlTransient |
|---|
| 63 | private Object parent; |
|---|
| 64 | |
|---|
| 65 | /** |
|---|
| 66 | * Gets the value of the gridCol property. |
|---|
| 67 | * |
|---|
| 68 | * <p> |
|---|
| 69 | * This accessor method returns a reference to the live list, |
|---|
| 70 | * not a snapshot. Therefore any modification you make to the |
|---|
| 71 | * returned list will be present inside the JAXB object. |
|---|
| 72 | * This is why there is not a <CODE>set</CODE> method for the gridCol property. |
|---|
| 73 | * |
|---|
| 74 | * <p> |
|---|
| 75 | * For example, to add a new item, do as follows: |
|---|
| 76 | * <pre> |
|---|
| 77 | * getGridCol().add(newItem); |
|---|
| 78 | * </pre> |
|---|
| 79 | * |
|---|
| 80 | * |
|---|
| 81 | * <p> |
|---|
| 82 | * Objects of the following type(s) are allowed in the list |
|---|
| 83 | * {@link TblGridCol } |
|---|
| 84 | * |
|---|
| 85 | * |
|---|
| 86 | */ |
|---|
| 87 | public List<TblGridCol> getGridCol() { |
|---|
| 88 | if (gridCol == null) { |
|---|
| 89 | gridCol = new ArrayList<TblGridCol>(); |
|---|
| 90 | } |
|---|
| 91 | return this.gridCol; |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | /** |
|---|
| 95 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 96 | * |
|---|
| 97 | * @return |
|---|
| 98 | * The parent object. |
|---|
| 99 | */ |
|---|
| 100 | public Object getParent() { |
|---|
| 101 | return this.parent; |
|---|
| 102 | } |
|---|
| 103 | |
|---|
| 104 | public void setParent(Object parent) { |
|---|
| 105 | this.parent = parent; |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | /** |
|---|
| 109 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 110 | * |
|---|
| 111 | * @param parent |
|---|
| 112 | * The parent object in the object tree. |
|---|
| 113 | * @param unmarshaller |
|---|
| 114 | * The unmarshaller that generated the instance. |
|---|
| 115 | */ |
|---|
| 116 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 117 | setParent(parent); |
|---|
| 118 | } |
|---|
| 119 | |
|---|
| 120 | } |
|---|