PDFCollectionNavigator.java
9.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.cos.CosDictionary
* com.adobe.internal.pdftoolkit.core.cos.CosObject
* com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
* com.adobe.internal.pdftoolkit.core.types.ASName
*/
package com.adobe.internal.pdftoolkit.pdf.interactive.navigation.collection;
import com.adobe.internal.pdftoolkit.core.cos.CosDictionary;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.types.ASName;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosDictionary;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosObject;
import com.adobe.internal.pdftoolkit.pdf.document.PDFDocument;
import com.adobe.internal.pdftoolkit.pdf.interactive.navigation.collection.PDFCollectionNavigatorStringsTree;
import com.adobe.internal.pdftoolkit.pdf.interactive.navigation.collection.PDFCollectionResourcesTree;
import com.adobe.internal.pdftoolkit.pdf.interactive.navigation.collection.PDFCollectionSWFLoadType;
import com.adobe.internal.pdftoolkit.pdf.interactive.navigation.collection.PDFCollectionSchema;
import java.util.Locale;
public class PDFCollectionNavigator
extends PDFCosDictionary {
public static final ASName k_SWF = ASName.create((String)"SWF");
public static final ASName k_Name = ASName.create((String)"Name");
public static final ASName k_Desc = ASName.create((String)"Desc");
public static final ASName k_Category = ASName.create((String)"Category");
public static final ASName k_APIVersion = ASName.create((String)"APIVersion");
public static final ASName k_Icon = ASName.create((String)"Icon");
public static final ASName k_Locale = ASName.create((String)"Locale");
public static final ASName k_LoadType = ASName.create((String)"LoadType");
public static final ASName k_Strings = ASName.create((String)"Strings");
public static final ASName k_InitialFields = ASName.create((String)"InitialFields");
public static final ASName k_Resources = ASName.create((String)"Resources");
private PDFCollectionNavigator(CosObject cosObject) throws PDFInvalidDocumentException {
super(cosObject);
}
public static PDFCollectionNavigator getInstance(CosObject cosObject) throws PDFInvalidDocumentException {
if (PDFCosObject.checkNullCosObject(cosObject) == null) {
return null;
}
PDFCollectionNavigator pdfObject = PDFCosObject.getCachedInstance(cosObject, PDFCollectionNavigator.class);
if (pdfObject == null) {
pdfObject = new PDFCollectionNavigator(cosObject);
}
return pdfObject;
}
public static PDFCollectionNavigator newInstance(PDFDocument pdfDocument) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosDictionary cosObject = PDFCosObject.newCosDictionary(pdfDocument);
PDFCollectionNavigator pdfObject = new PDFCollectionNavigator((CosObject)cosObject);
return pdfObject;
}
public String getSWF() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(k_SWF);
}
public void setSWF(String swf) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryStringValue(k_SWF, swf);
}
public String getName() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(k_Name);
}
public void setName(String name) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryStringValue(k_Name, name);
}
public String getDesc() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(k_Desc);
}
public void setDesc(String desc) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (desc == null) {
this.removeValue(k_Desc);
} else {
this.setDictionaryStringValue(k_Desc, desc);
}
}
public String getCategory() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(k_Category);
}
public void setCategory(String category) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (category == null) {
this.removeValue(k_Category);
} else {
this.setDictionaryStringValue(k_Category, category);
}
}
public String getID() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(ASName.k_ID);
}
public void setID(String id) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryStringValue(ASName.k_ID, id);
}
public String getVersion() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(ASName.k_Version);
}
public void setVersion(String version) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (version == null) {
this.removeValue(ASName.k_Version);
} else {
this.setDictionaryStringValue(ASName.k_Version, version);
}
}
public String getAPIVersion() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(k_APIVersion);
}
public void setAPIVersion(String apiVersion) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (apiVersion == null) {
this.removeValue(k_APIVersion);
} else {
this.setDictionaryStringValue(k_APIVersion, apiVersion);
}
}
public String getIcon() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryTextStringValue(k_Icon);
}
public void setIcon(String icon) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (icon == null) {
this.removeValue(k_Icon);
} else {
this.setDictionaryStringValue(k_Icon, icon);
}
}
public boolean hasLocale() {
return this.getCosDictionary().containsKey((Object)k_Locale);
}
public Locale getLocale() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
String localeString = this.getDictionaryTextStringValue(k_Locale);
if (localeString == null) {
return null;
}
return new Locale(localeString);
}
public void setLocale(Locale locale) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (locale == null) {
this.removeValue(k_Locale);
} else {
this.setDictionaryStringValue(k_Locale, locale.getDisplayName());
}
}
public PDFCollectionSWFLoadType getLoadType() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
ASName loadType = this.getDictionaryNameValue(k_LoadType);
if (loadType == null) {
return PDFCollectionSWFLoadType.defaultSWF;
}
return PDFCollectionSWFLoadType.getInstance(loadType);
}
public void setLoadType(PDFCollectionSWFLoadType loadType) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (loadType == null) {
this.removeValue(k_LoadType);
} else {
this.setDictionaryNameValue(k_LoadType, loadType.getLoadType());
}
}
public PDFCollectionNavigatorStringsTree getStrings() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFCollectionNavigatorStringsTree.getInstance(this.getDictionaryValue(k_Strings));
}
public void setStrings(PDFCollectionNavigatorStringsTree strings) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (strings == null) {
this.removeValue(k_Strings);
} else {
this.setDictionaryValue(k_Strings, strings);
}
}
public PDFCollectionSchema getInitialFields() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFCollectionSchema.getInstance(this.getDictionaryValue(k_InitialFields));
}
public void setInitialFields(PDFCollectionSchema initialFields) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (initialFields == null) {
this.removeValue(k_InitialFields);
} else {
this.setDictionaryValue(k_InitialFields, initialFields);
}
}
public PDFCollectionResourcesTree getResources() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFCollectionResourcesTree.getInstance(this.getDictionaryValue(k_Resources));
}
public void setResources(PDFCollectionResourcesTree resources) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (resources == null) {
this.removeValue(k_Resources);
} else {
this.setDictionaryValue(k_Resources, resources);
}
}
}