| 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 javax.xml.bind.Unmarshaller; |
|---|
| 25 | import javax.xml.bind.annotation.XmlAccessType; |
|---|
| 26 | import javax.xml.bind.annotation.XmlAccessorType; |
|---|
| 27 | import javax.xml.bind.annotation.XmlAttribute; |
|---|
| 28 | import javax.xml.bind.annotation.XmlRootElement; |
|---|
| 29 | import javax.xml.bind.annotation.XmlTransient; |
|---|
| 30 | import javax.xml.bind.annotation.XmlType; |
|---|
| 31 | import javax.xml.bind.annotation.XmlValue; |
|---|
| 32 | import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; |
|---|
| 33 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
|---|
| 34 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * <p>Java class for anonymous complex type. |
|---|
| 39 | * |
|---|
| 40 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 41 | * |
|---|
| 42 | * <pre> |
|---|
| 43 | * <complexType> |
|---|
| 44 | * <simpleContent> |
|---|
| 45 | * <extension base="<http://schemas.openxmlformats.org/wordprocessingml/2006/main>ST_String"> |
|---|
| 46 | * <attribute ref="{http://www.w3.org/XML/1998/namespace}space"/> |
|---|
| 47 | * </extension> |
|---|
| 48 | * </simpleContent> |
|---|
| 49 | * </complexType> |
|---|
| 50 | * </pre> |
|---|
| 51 | * |
|---|
| 52 | * |
|---|
| 53 | */ |
|---|
| 54 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 55 | @XmlType(name = "", propOrder = { |
|---|
| 56 | "value" |
|---|
| 57 | }) |
|---|
| 58 | @XmlRootElement(name = "delText") |
|---|
| 59 | public class DelText 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 | * |
|---|
| 96 | * Content Contains Significant Whitespace |
|---|
| 97 | * |
|---|
| 98 | * |
|---|
| 99 | * @return |
|---|
| 100 | * possible object is |
|---|
| 101 | * {@link String } |
|---|
| 102 | * |
|---|
| 103 | */ |
|---|
| 104 | public String getSpace() { |
|---|
| 105 | return space; |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | /** |
|---|
| 109 | * Sets the value of the space property. |
|---|
| 110 | * |
|---|
| 111 | * @param value |
|---|
| 112 | * allowed object is |
|---|
| 113 | * {@link String } |
|---|
| 114 | * |
|---|
| 115 | */ |
|---|
| 116 | public void setSpace(String value) { |
|---|
| 117 | this.space = value; |
|---|
| 118 | } |
|---|
| 119 | |
|---|
| 120 | /** |
|---|
| 121 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 122 | * |
|---|
| 123 | * @return |
|---|
| 124 | * The parent object. |
|---|
| 125 | */ |
|---|
| 126 | public Object getParent() { |
|---|
| 127 | return this.parent; |
|---|
| 128 | } |
|---|
| 129 | |
|---|
| 130 | public void setParent(Object parent) { |
|---|
| 131 | this.parent = parent; |
|---|
| 132 | } |
|---|
| 133 | |
|---|
| 134 | /** |
|---|
| 135 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 136 | * |
|---|
| 137 | * @param parent |
|---|
| 138 | * The parent object in the object tree. |
|---|
| 139 | * @param unmarshaller |
|---|
| 140 | * The unmarshaller that generated the instance. |
|---|
| 141 | */ |
|---|
| 142 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 143 | setParent(parent); |
|---|
| 144 | } |
|---|
| 145 | |
|---|
| 146 | } |
|---|