| 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.XmlTransient; |
|---|
| 29 | import javax.xml.bind.annotation.XmlType; |
|---|
| 30 | import org.jvnet.jaxb2_commons.ppp.Child; |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | /** |
|---|
| 34 | * <p>Java class for CT_Rel complex type. |
|---|
| 35 | * |
|---|
| 36 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 37 | * |
|---|
| 38 | * <pre> |
|---|
| 39 | * <complexType name="CT_Rel"> |
|---|
| 40 | * <complexContent> |
|---|
| 41 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 42 | * <attribute ref="{http://schemas.openxmlformats.org/officeDocument/2006/relationships}id use="required""/> |
|---|
| 43 | * </restriction> |
|---|
| 44 | * </complexContent> |
|---|
| 45 | * </complexType> |
|---|
| 46 | * </pre> |
|---|
| 47 | * |
|---|
| 48 | * |
|---|
| 49 | */ |
|---|
| 50 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 51 | @XmlType(name = "CT_Rel") |
|---|
| 52 | public class CTRel implements Child |
|---|
| 53 | { |
|---|
| 54 | |
|---|
| 55 | @XmlAttribute(namespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", required = true) |
|---|
| 56 | protected String id; |
|---|
| 57 | @XmlTransient |
|---|
| 58 | private Object parent; |
|---|
| 59 | |
|---|
| 60 | /** |
|---|
| 61 | * Relationship to Part |
|---|
| 62 | * |
|---|
| 63 | * @return |
|---|
| 64 | * possible object is |
|---|
| 65 | * {@link String } |
|---|
| 66 | * |
|---|
| 67 | */ |
|---|
| 68 | public String getId() { |
|---|
| 69 | return id; |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | /** |
|---|
| 73 | * Sets the value of the id property. |
|---|
| 74 | * |
|---|
| 75 | * @param value |
|---|
| 76 | * allowed object is |
|---|
| 77 | * {@link String } |
|---|
| 78 | * |
|---|
| 79 | */ |
|---|
| 80 | public void setId(String value) { |
|---|
| 81 | this.id = value; |
|---|
| 82 | } |
|---|
| 83 | |
|---|
| 84 | /** |
|---|
| 85 | * Gets the parent object in the object tree representing the unmarshalled xml document. |
|---|
| 86 | * |
|---|
| 87 | * @return |
|---|
| 88 | * The parent object. |
|---|
| 89 | */ |
|---|
| 90 | public Object getParent() { |
|---|
| 91 | return this.parent; |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | public void setParent(Object parent) { |
|---|
| 95 | this.parent = parent; |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | /** |
|---|
| 99 | * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. |
|---|
| 100 | * |
|---|
| 101 | * @param parent |
|---|
| 102 | * The parent object in the object tree. |
|---|
| 103 | * @param unmarshaller |
|---|
| 104 | * The unmarshaller that generated the instance. |
|---|
| 105 | */ |
|---|
| 106 | public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { |
|---|
| 107 | setParent(parent); |
|---|
| 108 | } |
|---|
| 109 | |
|---|
| 110 | } |
|---|