| 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.dml; |
|---|
| 23 | |
|---|
| 24 | import java.util.ArrayList; |
|---|
| 25 | import java.util.List; |
|---|
| 26 | import javax.xml.bind.annotation.XmlAccessType; |
|---|
| 27 | import javax.xml.bind.annotation.XmlAccessorType; |
|---|
| 28 | import javax.xml.bind.annotation.XmlElement; |
|---|
| 29 | import javax.xml.bind.annotation.XmlElements; |
|---|
| 30 | import javax.xml.bind.annotation.XmlType; |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | /** |
|---|
| 34 | * <p>Java class for CT_TextParagraph complex type. |
|---|
| 35 | * |
|---|
| 36 | * <p>The following schema fragment specifies the expected content contained within this class. |
|---|
| 37 | * |
|---|
| 38 | * <pre> |
|---|
| 39 | * <complexType name="CT_TextParagraph"> |
|---|
| 40 | * <complexContent> |
|---|
| 41 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
|---|
| 42 | * <sequence> |
|---|
| 43 | * <element name="pPr" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_TextParagraphProperties" minOccurs="0"/> |
|---|
| 44 | * <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_TextRun" maxOccurs="unbounded" minOccurs="0"/> |
|---|
| 45 | * <element name="endParaRPr" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_TextCharacterProperties" minOccurs="0"/> |
|---|
| 46 | * </sequence> |
|---|
| 47 | * </restriction> |
|---|
| 48 | * </complexContent> |
|---|
| 49 | * </complexType> |
|---|
| 50 | * </pre> |
|---|
| 51 | * |
|---|
| 52 | * |
|---|
| 53 | */ |
|---|
| 54 | @XmlAccessorType(XmlAccessType.FIELD) |
|---|
| 55 | @XmlType(name = "CT_TextParagraph", propOrder = { |
|---|
| 56 | "pPr", |
|---|
| 57 | "egTextRun", |
|---|
| 58 | "endParaRPr" |
|---|
| 59 | }) |
|---|
| 60 | public class CTTextParagraph { |
|---|
| 61 | |
|---|
| 62 | protected CTTextParagraphProperties pPr; |
|---|
| 63 | @XmlElements({ |
|---|
| 64 | @XmlElement(name = "r", type = CTRegularTextRun.class), |
|---|
| 65 | @XmlElement(name = "fld", type = CTTextField.class), |
|---|
| 66 | @XmlElement(name = "br", type = CTTextLineBreak.class) |
|---|
| 67 | }) |
|---|
| 68 | protected List<Object> egTextRun; |
|---|
| 69 | protected CTTextCharacterProperties endParaRPr; |
|---|
| 70 | |
|---|
| 71 | /** |
|---|
| 72 | * Gets the value of the pPr property. |
|---|
| 73 | * |
|---|
| 74 | * @return |
|---|
| 75 | * possible object is |
|---|
| 76 | * {@link CTTextParagraphProperties } |
|---|
| 77 | * |
|---|
| 78 | */ |
|---|
| 79 | public CTTextParagraphProperties getPPr() { |
|---|
| 80 | return pPr; |
|---|
| 81 | } |
|---|
| 82 | |
|---|
| 83 | /** |
|---|
| 84 | * Sets the value of the pPr property. |
|---|
| 85 | * |
|---|
| 86 | * @param value |
|---|
| 87 | * allowed object is |
|---|
| 88 | * {@link CTTextParagraphProperties } |
|---|
| 89 | * |
|---|
| 90 | */ |
|---|
| 91 | public void setPPr(CTTextParagraphProperties value) { |
|---|
| 92 | this.pPr = value; |
|---|
| 93 | } |
|---|
| 94 | |
|---|
| 95 | /** |
|---|
| 96 | * Gets the value of the egTextRun property. |
|---|
| 97 | * |
|---|
| 98 | * <p> |
|---|
| 99 | * This accessor method returns a reference to the live list, |
|---|
| 100 | * not a snapshot. Therefore any modification you make to the |
|---|
| 101 | * returned list will be present inside the JAXB object. |
|---|
| 102 | * This is why there is not a <CODE>set</CODE> method for the egTextRun property. |
|---|
| 103 | * |
|---|
| 104 | * <p> |
|---|
| 105 | * For example, to add a new item, do as follows: |
|---|
| 106 | * <pre> |
|---|
| 107 | * getEGTextRun().add(newItem); |
|---|
| 108 | * </pre> |
|---|
| 109 | * |
|---|
| 110 | * |
|---|
| 111 | * <p> |
|---|
| 112 | * Objects of the following type(s) are allowed in the list |
|---|
| 113 | * {@link CTRegularTextRun } |
|---|
| 114 | * {@link CTTextField } |
|---|
| 115 | * {@link CTTextLineBreak } |
|---|
| 116 | * |
|---|
| 117 | * |
|---|
| 118 | */ |
|---|
| 119 | public List<Object> getEGTextRun() { |
|---|
| 120 | if (egTextRun == null) { |
|---|
| 121 | egTextRun = new ArrayList<Object>(); |
|---|
| 122 | } |
|---|
| 123 | return this.egTextRun; |
|---|
| 124 | } |
|---|
| 125 | |
|---|
| 126 | /** |
|---|
| 127 | * Gets the value of the endParaRPr property. |
|---|
| 128 | * |
|---|
| 129 | * @return |
|---|
| 130 | * possible object is |
|---|
| 131 | * {@link CTTextCharacterProperties } |
|---|
| 132 | * |
|---|
| 133 | */ |
|---|
| 134 | public CTTextCharacterProperties getEndParaRPr() { |
|---|
| 135 | return endParaRPr; |
|---|
| 136 | } |
|---|
| 137 | |
|---|
| 138 | /** |
|---|
| 139 | * Sets the value of the endParaRPr property. |
|---|
| 140 | * |
|---|
| 141 | * @param value |
|---|
| 142 | * allowed object is |
|---|
| 143 | * {@link CTTextCharacterProperties } |
|---|
| 144 | * |
|---|
| 145 | */ |
|---|
| 146 | public void setEndParaRPr(CTTextCharacterProperties value) { |
|---|
| 147 | this.endParaRPr = value; |
|---|
| 148 | } |
|---|
| 149 | |
|---|
| 150 | } |
|---|