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