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