| 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 | package org.docx4j.wml; |
|---|
| 22 | |
|---|
| 23 | import javax.xml.bind.Unmarshaller; |
|---|
| 24 | import javax.xml.bind.annotation.XmlAccessType; |
|---|
| 25 | import javax.xml.bind.annotation.XmlAccessorType; |
|---|
| 26 | import javax.xml.bind.annotation.XmlRootElement; |
|---|
| 27 | import javax.xml.bind.annotation.XmlAttribute; |
|---|
| 28 | import javax.xml.bind.annotation.XmlTransient; |
|---|
| 29 | import javax.xml.bind.annotation.XmlType; |
|---|
| 30 | import javax.xml.bind.annotation.XmlValue; |
|---|
| 31 | import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; |
|---|
| 32 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
|---|
| 33 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | /** |
|---|
| 37 | * <p>Java class for CT_Text complex type. |
|---|
| 38 | * |
|---|
| 39 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 40 | * |
|---|
| 41 | * <pre> |
|---|
| 42 | * <complexType name="CT_Text"> |
|---|
| 43 | * <simpleContent> |
|---|
| 44 | * <extension base="<http://schemas.openxmlformats.org/wordprocessingml/2006/main>ST_String"> |
|---|
| 45 | * <attribute ref="{http://www.w3.org/XML/1998/namespace}space"/> |
|---|
| 46 | * </extension> |
|---|
| 47 | * </simpleContent> |
|---|
| 48 | * </complexType> |
|---|
| 49 | * </pre> |
|---|
| 50 | * |
|---|
| 51 | * |
|---|
| 52 | */ |
|---|
| 53 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 54 | @XmlType(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", name = "CT_Text", propOrder = { |
|---|
| 55 | "value" |
|---|
| 56 | }) |
|---|
| 57 | @XmlRootElement(name = "t") |
|---|
| 58 | public class Text |
|---|
| 59 | implements Child |
|---|
| 60 | { |
|---|
| 61 | |
|---|
| 62 | @XmlValue |
|---|
| 63 | protected String value; |
|---|
| 64 | @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") |
|---|
| 65 | @XmlJavaTypeAdapter(CollapsedStringAdapter.class) |
|---|
| 66 | protected String space; |
|---|
| 67 | @XmlTransient |
|---|
| 68 | private Object parent; |
|---|
| 69 | |
|---|
| 70 | /** |
|---|
| 71 | * String |
|---|
| 72 | * |
|---|
| 73 | * @return |
|---|
| 74 | * possible object is |
|---|
| 75 | * {@link String } |
|---|
| 76 | * |
|---|
| 77 | */ |
|---|
| 78 | public String getValue() { |
|---|
| 79 | return value; |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | /** |
|---|
| 83 | * Sets the value of the value property. |
|---|
| 84 | * |
|---|
| 85 | * @param value |
|---|
| 86 | * allowed object is |
|---|
| 87 | * {@link String } |
|---|
| 88 | * |
|---|
| 89 | */ |
|---|
| 90 | public void setValue(String value) { |
|---|
| 91 | this.value = value; |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | /** |
|---|
| 95 | * Content Contains Significant |
|---|
| 96 | * Whitespace |
|---|
| 97 | * |
|---|
| 98 | * @return |
|---|
| 99 | * possible object is |
|---|
| 100 | * {@link String } |
|---|
| 101 | * |
|---|
| 102 | */ |
|---|
| 103 | public String getSpace() { |
|---|
| 104 | return space; |
|---|
| 105 | } |
|---|
| 106 | |
|---|
| 107 | /** |
|---|
| 108 | * Sets the value of the space property. |
|---|
| 109 | * |
|---|
| 110 | * @param value |
|---|
| 111 | * allowed object is |
|---|
| 112 | * {@link String } |
|---|
| 113 | * |
|---|
| 114 | */ |
|---|
| 115 | public void setSpace(String value) { |
|---|
| 116 | this.space = value; |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | /** |
|---|
| 120 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 121 | * |
|---|
| 122 | * @return |
|---|
| 123 | * The parent object. |
|---|
| 124 | */ |
|---|
| 125 | public Object getParent() { |
|---|
| 126 | return this.parent; |
|---|
| 127 | } |
|---|
| 128 | |
|---|
| 129 | public void setParent(Object parent) { |
|---|
| 130 | this.parent = parent; |
|---|
| 131 | } |
|---|
| 132 | |
|---|
| 133 | /** |
|---|
| 134 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 135 | * |
|---|
| 136 | * @param parent |
|---|
| 137 | * The parent object in the object tree. |
|---|
| 138 | * @param unmarshaller |
|---|
| 139 | * The unmarshaller that generated the instance. |
|---|
| 140 | */ |
|---|
| 141 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 142 | setParent(parent); |
|---|
| 143 | } |
|---|
| 144 | |
|---|
| 145 | } |
|---|