]> _ Git - cubeextranet.git/blob
066f9ed379152b6f2fdc6bc2d7bbab16d573ba4e
[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.interactive.annotation;
18
19 import org.apache.pdfbox.cos.COSBase;
20 import org.apache.pdfbox.cos.COSDictionary;
21 import org.apache.pdfbox.cos.COSName;
22 import org.apache.pdfbox.pdmodel.common.COSObjectable;
23
24 /**
25  * This class represents an external data dictionary.
26  * 
27  * @version $Revision: 1.0 $
28  * 
29  */
30 public class PDExternalDataDictionary implements COSObjectable
31 {
32
33     private COSDictionary dataDictionary;
34
35     /**
36      * Constructor.
37      */
38     public PDExternalDataDictionary()
39     {
40         this.dataDictionary = new COSDictionary();
41         this.dataDictionary.setName(COSName.TYPE, "ExData");
42     }
43
44     /**
45      * Constructor.
46      * 
47      *  @param dictionary Dictionary
48      */
49     public PDExternalDataDictionary(COSDictionary dictionary)
50     {
51         this.dataDictionary = dictionary;
52     }
53
54     /**
55      * {@inheritDoc}
56      */
57     public COSBase getCOSObject()
58     {
59         return this.dataDictionary;
60     }
61
62     /**
63      * returns the dictionary.
64      *
65      * @return the dictionary
66      */
67     public COSDictionary getDictionary()
68     {
69         return this.dataDictionary;
70     }
71
72     /**
73      * returns the type of the external data dictionary.
74      * It must be "ExData", if present
75      * @return the type of the external data dictionary
76      */
77     public String getType()
78     {
79         return this.getDictionary().getNameAsString(COSName.TYPE, "ExData");
80     }
81
82     /**
83      * returns the subtype of the external data dictionary.
84      * @return the subtype of the external data dictionary
85      */
86     public String getSubtype()
87     {
88         return this.getDictionary().getNameAsString(COSName.SUBTYPE);
89     }
90
91     /**
92      * This will set the subtype of the external data dictionary.
93      * @param subtype the subtype of the external data dictionary
94      */
95     public void setSubtype(String subtype)
96     {
97         this.getDictionary().setName(COSName.SUBTYPE, subtype);
98     }
99
100 }