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
22 * A List attribute object.
\r
24 * @author <a href="mailto:Johannes%20Koch%20%3Ckoch@apache.org%3E">Johannes Koch</a>
\r
25 * @version $Revision: $
\r
27 public class PDListAttributeObject extends PDStandardAttributeObject
\r
31 * standard attribute owner: List
\r
33 public static final String OWNER_LIST = "List";
\r
35 protected static final String LIST_NUMBERING = "ListNumbering";
\r
38 * ListNumbering: Circle: Open circular bullet
\r
40 public static final String LIST_NUMBERING_CIRCLE = "Circle";
\r
42 * ListNumbering: Decimal: Decimal arabic numerals (1–9, 10–99, …)
\r
44 public static final String LIST_NUMBERING_DECIMAL = "Decimal";
\r
46 * ListNumbering: Disc: Solid circular bullet
\r
48 public static final String LIST_NUMBERING_DISC = "Disc";
\r
50 * ListNumbering: LowerAlpha: Lowercase letters (a, b, c, …)
\r
52 public static final String LIST_NUMBERING_LOWER_ALPHA = "LowerAlpha";
\r
54 * ListNumbering: LowerRoman: Lowercase roman numerals (i, ii, iii, iv, …)
\r
56 public static final String LIST_NUMBERING_LOWER_ROMAN = "LowerRoman";
\r
58 * ListNumbering: None: No autonumbering; Lbl elements (if present) contain arbitrary text
\r
59 * not subject to any numbering scheme
\r
61 public static final String LIST_NUMBERING_NONE = "None";
\r
63 * ListNumbering: Square: Solid square bullet
\r
65 public static final String LIST_NUMBERING_SQUARE = "Square";
\r
67 * ListNumbering: UpperAlpha: Uppercase letters (A, B, C, …)
\r
69 public static final String LIST_NUMBERING_UPPER_ALPHA = "UpperAlpha";
\r
71 * ListNumbering: UpperRoman: Uppercase roman numerals (I, II, III, IV, …)
\r
73 public static final String LIST_NUMBERING_UPPER_ROMAN = "UpperRoman";
\r
77 * Default constructor.
\r
79 public PDListAttributeObject()
\r
81 this.setOwner(OWNER_LIST);
\r
85 * Creates a new List attribute object with a given dictionary.
\r
87 * @param dictionary the dictionary
\r
89 public PDListAttributeObject(COSDictionary dictionary)
\r
96 * Gets the list numbering (ListNumbering). The default value is
\r
97 * {@link #LIST_NUMBERING_NONE}.
\r
99 * @return the list numbering
\r
101 public String getListNumbering()
\r
103 return this.getName(LIST_NUMBERING, LIST_NUMBERING_NONE);
\r
107 * Sets the list numbering (ListNumbering). The value shall be one of the
\r
110 * <li>{@link #LIST_NUMBERING_NONE},</li>
\r
111 * <li>{@link #LIST_NUMBERING_DISC},</li>
\r
112 * <li>{@link #LIST_NUMBERING_CIRCLE},</li>
\r
113 * <li>{@link #LIST_NUMBERING_SQUARE},</li>
\r
114 * <li>{@link #LIST_NUMBERING_DECIMAL},</li>
\r
115 * <li>{@link #LIST_NUMBERING_UPPER_ROMAN},</li>
\r
116 * <li>{@link #LIST_NUMBERING_LOWER_ROMAN},</li>
\r
117 * <li>{@link #LIST_NUMBERING_UPPER_ALPHA},</li>
\r
118 * <li>{@link #LIST_NUMBERING_LOWER_ALPHA}.</li>
\r
121 * @param listNumbering the list numbering
\r
123 public void setListNumbering(String listNumbering)
\r
125 this.setName(LIST_NUMBERING, listNumbering);
\r
129 public String toString()
\r
131 StringBuilder sb = new StringBuilder().append(super.toString());
\r
132 if (this.isSpecified(LIST_NUMBERING))
\r
134 sb.append(", ListNumbering=").append(this.getListNumbering());
\r
136 return sb.toString();
\r