]> _ Git - cubeextranet.git/blob
420e9e4b1ccedae41aa9e7dc25cc356d6ab674df
[cubeextranet.git] /
1 /*
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
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17 package org.apache.pdfbox.pdmodel.documentinterchange.taggedpdf;
18
19 import org.apache.pdfbox.cos.COSDictionary;
20
21 /**
22  * A List attribute object.
23  * 
24  * @author <a href="mailto:Johannes%20Koch%20%3Ckoch@apache.org%3E">Johannes Koch</a>
25  * @version $Revision: $
26  */
27 public class PDListAttributeObject extends PDStandardAttributeObject
28 {
29
30     /**
31      * standard attribute owner: List
32      */
33     public static final String OWNER_LIST = "List";
34
35     protected static final String LIST_NUMBERING = "ListNumbering";
36
37     /**
38      * ListNumbering: Circle: Open circular bullet
39      */
40     public static final String LIST_NUMBERING_CIRCLE = "Circle";
41     /**
42      * ListNumbering: Decimal: Decimal arabic numerals (1–9, 10–99, …)
43      */
44     public static final String LIST_NUMBERING_DECIMAL = "Decimal";
45     /**
46      * ListNumbering: Disc: Solid circular bullet
47      */
48     public static final String LIST_NUMBERING_DISC = "Disc";
49     /**
50      * ListNumbering: LowerAlpha: Lowercase letters (a, b, c, …)
51      */
52     public static final String LIST_NUMBERING_LOWER_ALPHA = "LowerAlpha";
53     /**
54      * ListNumbering: LowerRoman: Lowercase roman numerals (i, ii, iii, iv, …)
55      */
56     public static final String LIST_NUMBERING_LOWER_ROMAN = "LowerRoman";
57     /**
58      * ListNumbering: None: No autonumbering; Lbl elements (if present) contain arbitrary text
59      * not subject to any numbering scheme
60      */
61     public static final String LIST_NUMBERING_NONE = "None";
62     /**
63      * ListNumbering: Square: Solid square bullet
64      */
65     public static final String LIST_NUMBERING_SQUARE = "Square";
66     /**
67      * ListNumbering: UpperAlpha: Uppercase letters (A, B, C, …)
68      */
69     public static final String LIST_NUMBERING_UPPER_ALPHA = "UpperAlpha";
70     /**
71      * ListNumbering: UpperRoman: Uppercase roman numerals (I, II, III, IV, …)
72      */
73     public static final String LIST_NUMBERING_UPPER_ROMAN = "UpperRoman";
74
75
76     /**
77      * Default constructor.
78      */
79     public PDListAttributeObject()
80     {
81         this.setOwner(OWNER_LIST);
82     }
83
84     /**
85      * Creates a new List attribute object with a given dictionary.
86      * 
87      * @param dictionary the dictionary
88      */
89     public PDListAttributeObject(COSDictionary dictionary)
90     {
91         super(dictionary);
92     }
93
94
95     /**
96      * Gets the list numbering (ListNumbering). The default value is
97      * {@link #LIST_NUMBERING_NONE}.
98      * 
99      * @return the list numbering
100      */
101     public String getListNumbering()
102     {
103         return this.getName(LIST_NUMBERING, LIST_NUMBERING_NONE);
104     }
105
106     /**
107      * Sets the list numbering (ListNumbering). The value shall be one of the
108      * following:
109      * <ul>
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>
119      * </ul>
120      * 
121      * @param listNumbering the list numbering
122      */
123     public void setListNumbering(String listNumbering)
124     {
125         this.setName(LIST_NUMBERING, listNumbering);
126     }
127
128     @Override
129     public String toString()
130     {
131         StringBuilder sb = new StringBuilder().append(super.toString());
132         if (this.isSpecified(LIST_NUMBERING))
133         {
134             sb.append(", ListNumbering=").append(this.getListNumbering());
135         }
136         return sb.toString();
137     }
138
139
140 }