2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package org.apache.pdfbox.pdmodel.documentinterchange.taggedpdf;
19 import org.apache.pdfbox.cos.COSDictionary;
20 import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureElement;
23 * An Export Format attribute object.
25 * @author <a href="mailto:Johannes%20Koch%20%3Ckoch@apache.org%3E">Johannes Koch</a>
26 * @version $Revision: $
28 public class PDExportFormatAttributeObject extends PDLayoutAttributeObject
32 * standard attribute owner: XML-1.00
34 public static final String OWNER_XML_1_00 = "XML-1.00";
36 * standard attribute owner: HTML-3.2
38 public static final String OWNER_HTML_3_20 = "HTML-3.2";
40 * standard attribute owner: HTML-4.01
42 public static final String OWNER_HTML_4_01 = "HTML-4.01";
44 * standard attribute owner: OEB-1.00
46 public static final String OWNER_OEB_1_00 = "OEB-1.00";
48 * standard attribute owner: RTF-1.05
50 public static final String OWNER_RTF_1_05 = "RTF-1.05";
52 * standard attribute owner: CSS-1.00
54 public static final String OWNER_CSS_1_00 = "CSS-1.00";
56 * standard attribute owner: CSS-2.00
58 public static final String OWNER_CSS_2_00 = "CSS-2.00";
62 * Default constructor.
64 public PDExportFormatAttributeObject(String owner)
70 * Creates a new ExportFormat attribute object with a given dictionary.
72 * @param dictionary the dictionary
74 public PDExportFormatAttributeObject(COSDictionary dictionary)
81 * Gets the list numbering (ListNumbering). The default value is
82 * {@link #LIST_NUMBERING_NONE}.
84 * @return the list numbering
86 public String getListNumbering()
88 return this.getName(PDListAttributeObject.LIST_NUMBERING,
89 PDListAttributeObject.LIST_NUMBERING_NONE);
93 * Sets the list numbering (ListNumbering). The value shall be one of the
96 * <li>{@link #LIST_NUMBERING_NONE},</li>
97 * <li>{@link #LIST_NUMBERING_DISC},</li>
98 * <li>{@link #LIST_NUMBERING_CIRCLE},</li>
99 * <li>{@link #LIST_NUMBERING_SQUARE},</li>
100 * <li>{@link #LIST_NUMBERING_DECIMAL},</li>
101 * <li>{@link #LIST_NUMBERING_UPPER_ROMAN},</li>
102 * <li>{@link #LIST_NUMBERING_LOWER_ROMAN},</li>
103 * <li>{@link #LIST_NUMBERING_UPPER_ALPHA},</li>
104 * <li>{@link #LIST_NUMBERING_LOWER_ALPHA}.</li>
107 * @param listNumbering the list numbering
109 public void setListNumbering(String listNumbering)
111 this.setName(PDListAttributeObject.LIST_NUMBERING, listNumbering);
115 * Gets the number of rows in the enclosing table that shall be spanned by
116 * the cell (RowSpan). The default value is 1.
118 * @return the row span
120 public int getRowSpan()
122 return this.getInteger(PDTableAttributeObject.ROW_SPAN, 1);
126 * Sets the number of rows in the enclosing table that shall be spanned by
127 * the cell (RowSpan).
129 * @param rowSpan the row span
131 public void setRowSpan(int rowSpan)
133 this.setInteger(PDTableAttributeObject.ROW_SPAN, rowSpan);
137 * Gets the number of columns in the enclosing table that shall be spanned
138 * by the cell (ColSpan). The default value is 1.
140 * @return the column span
142 public int getColSpan()
144 return this.getInteger(PDTableAttributeObject.COL_SPAN, 1);
148 * Sets the number of columns in the enclosing table that shall be spanned
149 * by the cell (ColSpan).
151 * @param colSpan the column span
153 public void setColSpan(int colSpan)
155 this.setInteger(PDTableAttributeObject.COL_SPAN, colSpan);
159 * Gets the headers (Headers). An array of byte strings, where each string
160 * shall be the element identifier (see the
161 * {@link PDStructureElement#getElementIdentifier()}) for a TH structure
162 * element that shall be used as a header associated with this cell.
164 * @return the headers.
166 public String[] getHeaders()
168 return this.getArrayOfString(PDTableAttributeObject.HEADERS);
172 * Sets the headers (Headers). An array of byte strings, where each string
173 * shall be the element identifier (see the
174 * {@link PDStructureElement#getElementIdentifier()}) for a TH structure
175 * element that shall be used as a header associated with this cell.
177 * @param headers the headers
179 public void setHeaders(String[] headers)
181 this.setArrayOfString(PDTableAttributeObject.HEADERS, headers);
185 * Gets the scope (Scope). It shall reflect whether the header cell applies
186 * to the rest of the cells in the row that contains it, the column that
187 * contains it, or both the row and the column that contain it.
191 public String getScope()
193 return this.getName(PDTableAttributeObject.SCOPE);
197 * Sets the scope (Scope). It shall reflect whether the header cell applies
198 * to the rest of the cells in the row that contains it, the column that
199 * contains it, or both the row and the column that contain it. The value
200 * shall be one of the following:
202 * <li>{@link #SCOPE_ROW},</li>
203 * <li>{@link #SCOPE_COLUMN}, or</li>
204 * <li>{@link #SCOPE_BOTH}.</li>
207 * @param scope the scope
209 public void setScope(String scope)
211 this.setName(PDTableAttributeObject.SCOPE, scope);
215 * Gets the summary of the table’s purpose and structure.
217 * @return the summary
219 public String getSummary()
221 return this.getString(PDTableAttributeObject.SUMMARY);
225 * Sets the summary of the table’s purpose and structure.
227 * @param summary the summary
229 public void setSummary(String summary)
231 this.setString(PDTableAttributeObject.SUMMARY, summary);
236 public String toString()
238 StringBuilder sb = new StringBuilder().append(super.toString());
239 if (this.isSpecified(PDListAttributeObject.LIST_NUMBERING))
241 sb.append(", ListNumbering=").append(this.getListNumbering());
243 if (this.isSpecified(PDTableAttributeObject.ROW_SPAN))
245 sb.append(", RowSpan=").append(String.valueOf(this.getRowSpan()));
247 if (this.isSpecified(PDTableAttributeObject.COL_SPAN))
249 sb.append(", ColSpan=").append(String.valueOf(this.getColSpan()));
251 if (this.isSpecified(PDTableAttributeObject.HEADERS))
253 sb.append(", Headers=").append(arrayToString(this.getHeaders()));
255 if (this.isSpecified(PDTableAttributeObject.SCOPE))
257 sb.append(", Scope=").append(this.getScope());
259 if (this.isSpecified(PDTableAttributeObject.SUMMARY))
261 sb.append(", Summary=").append(this.getSummary());
263 return sb.toString();