| 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.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.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * <p>Java class for CT_FFData complex type. |
|---|
| 39 | * |
|---|
| 40 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 41 | * |
|---|
| 42 | * <pre> |
|---|
| 43 | * <complexType name="CT_FFData"> |
|---|
| 44 | * <complexContent> |
|---|
| 45 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 46 | * <choice maxOccurs="unbounded"> |
|---|
| 47 | * <element name="name" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FFName"/> |
|---|
| 48 | * <element name="enabled" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}BooleanDefaultTrue"/> |
|---|
| 49 | * <element name="calcOnExit" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}BooleanDefaultTrue"/> |
|---|
| 50 | * <element name="entryMacro" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_MacroName" minOccurs="0"/> |
|---|
| 51 | * <element name="exitMacro" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_MacroName" minOccurs="0"/> |
|---|
| 52 | * <element name="helpText" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FFHelpText" minOccurs="0"/> |
|---|
| 53 | * <element name="statusText" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FFStatusText" minOccurs="0"/> |
|---|
| 54 | * <choice> |
|---|
| 55 | * <element name="checkBox" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FFCheckBox"/> |
|---|
| 56 | * <element name="ddList" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FFDDList"/> |
|---|
| 57 | * <element name="textInput" type="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}CT_FFTextInput"/> |
|---|
| 58 | * </choice> |
|---|
| 59 | * </choice> |
|---|
| 60 | * </restriction> |
|---|
| 61 | * </complexContent> |
|---|
| 62 | * </complexType> |
|---|
| 63 | * </pre> |
|---|
| 64 | * |
|---|
| 65 | * |
|---|
| 66 | */ |
|---|
| 67 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 68 | @XmlType(name = "CT_FFData", propOrder = { |
|---|
| 69 | "nameOrEnabledOrCalcOnExit" |
|---|
| 70 | }) |
|---|
| 71 | public class CTFFData |
|---|
| 72 | implements Child |
|---|
| 73 | { |
|---|
| 74 | |
|---|
| 75 | @XmlElementRefs({ |
|---|
| 76 | @XmlElementRef(name = "name", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 77 | @XmlElementRef(name = "calcOnExit", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 78 | @XmlElementRef(name = "helpText", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 79 | @XmlElementRef(name = "ddList", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 80 | @XmlElementRef(name = "textInput", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 81 | @XmlElementRef(name = "statusText", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 82 | @XmlElementRef(name = "checkBox", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 83 | @XmlElementRef(name = "enabled", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 84 | @XmlElementRef(name = "entryMacro", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class), |
|---|
| 85 | @XmlElementRef(name = "exitMacro", namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", type = JAXBElement.class) |
|---|
| 86 | }) |
|---|
| 87 | protected List<JAXBElement<?>> nameOrEnabledOrCalcOnExit; |
|---|
| 88 | @XmlTransient |
|---|
| 89 | private Object parent; |
|---|
| 90 | |
|---|
| 91 | /** |
|---|
| 92 | * Gets the value of the nameOrEnabledOrCalcOnExit property. |
|---|
| 93 | * |
|---|
| 94 | * <p> |
|---|
| 95 | * This accessor method returns a reference to the live list, |
|---|
| 96 | * not a snapshot. Therefore any modification you make to the |
|---|
| 97 | * returned list will be present inside the JAXB object. |
|---|
| 98 | * This is why there is not a <CODE>set</CODE> method for the nameOrEnabledOrCalcOnExit property. |
|---|
| 99 | * |
|---|
| 100 | * <p> |
|---|
| 101 | * For example, to add a new item, do as follows: |
|---|
| 102 | * <pre> |
|---|
| 103 | * getNameOrEnabledOrCalcOnExit().add(newItem); |
|---|
| 104 | * </pre> |
|---|
| 105 | * |
|---|
| 106 | * |
|---|
| 107 | * <p> |
|---|
| 108 | * Objects of the following type(s) are allowed in the list |
|---|
| 109 | * {@link JAXBElement }{@code <}{@link CTFFName }{@code >} |
|---|
| 110 | * {@link JAXBElement }{@code <}{@link BooleanDefaultTrue }{@code >} |
|---|
| 111 | * {@link JAXBElement }{@code <}{@link CTFFHelpText }{@code >} |
|---|
| 112 | * {@link JAXBElement }{@code <}{@link CTFFDDList }{@code >} |
|---|
| 113 | * {@link JAXBElement }{@code <}{@link CTFFStatusText }{@code >} |
|---|
| 114 | * {@link JAXBElement }{@code <}{@link CTFFTextInput }{@code >} |
|---|
| 115 | * {@link JAXBElement }{@code <}{@link CTFFCheckBox }{@code >} |
|---|
| 116 | * {@link JAXBElement }{@code <}{@link BooleanDefaultTrue }{@code >} |
|---|
| 117 | * {@link JAXBElement }{@code <}{@link CTMacroName }{@code >} |
|---|
| 118 | * {@link JAXBElement }{@code <}{@link CTMacroName }{@code >} |
|---|
| 119 | * |
|---|
| 120 | * |
|---|
| 121 | */ |
|---|
| 122 | public List<JAXBElement<?>> getNameOrEnabledOrCalcOnExit() { |
|---|
| 123 | if (nameOrEnabledOrCalcOnExit == null) { |
|---|
| 124 | nameOrEnabledOrCalcOnExit = new ArrayList<JAXBElement<?>>(); |
|---|
| 125 | } |
|---|
| 126 | return this.nameOrEnabledOrCalcOnExit; |
|---|
| 127 | } |
|---|
| 128 | |
|---|
| 129 | /** |
|---|
| 130 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 131 | * |
|---|
| 132 | * @return |
|---|
| 133 | * The parent object. |
|---|
| 134 | */ |
|---|
| 135 | public Object getParent() { |
|---|
| 136 | return this.parent; |
|---|
| 137 | } |
|---|
| 138 | |
|---|
| 139 | public void setParent(Object parent) { |
|---|
| 140 | this.parent = parent; |
|---|
| 141 | } |
|---|
| 142 | |
|---|
| 143 | /** |
|---|
| 144 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 145 | * |
|---|
| 146 | * @param parent |
|---|
| 147 | * The parent object in the object tree. |
|---|
| 148 | * @param unmarshaller |
|---|
| 149 | * The unmarshaller that generated the instance. |
|---|
| 150 | */ |
|---|
| 151 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 152 | setParent(parent); |
|---|
| 153 | } |
|---|
| 154 | |
|---|
| 155 | } |
|---|