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