Package org.apache.pdfbox.cos
Class UnmodifiableCOSDictionary
java.lang.Object
org.apache.pdfbox.cos.COSBase
org.apache.pdfbox.cos.COSDictionary
org.apache.pdfbox.cos.UnmodifiableCOSDictionary
- All Implemented Interfaces:
COSUpdateInfo
,COSObjectable
An unmodifiable COSDictionary.
-
Field Summary
Fields inherited from class org.apache.pdfbox.cos.COSDictionary
items
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(COSDictionary dic) This will add all of the dictionaries keys/values to this dictionary.void
clear()
This will clear all items in the map.void
mergeInto
(COSDictionary dic) This will add all of the dictionaries keys/values to this dictionary, but only if they don't already exist.void
removeItem
(COSName key) This will remove an item for the dictionary.void
setBoolean
(String key, boolean value) This will set an item in the dictionary.void
setBoolean
(COSName key, boolean value) This will set an item in the dictionary.void
Set the value of a date entry in the dictionary.void
Set the date object.void
setEmbeddedDate
(String embedded, String key, Calendar date) Set the value of a date entry in the dictionary.void
setEmbeddedDate
(String embedded, COSName key, Calendar date) Set the date object.void
setEmbeddedInt
(String embeddedDictionary, String key, int value) This is a convenience method that will convert the value to a COSInteger object.void
setEmbeddedInt
(String embeddedDictionary, COSName key, int value) This is a convenience method that will convert the value to a COSInteger object.void
setEmbeddedString
(String embedded, String key, String value) This is a convenience method that will convert the value to a COSString object.void
setEmbeddedString
(String embedded, COSName key, String value) This is a convenience method that will convert the value to a COSString object.void
Sets the given boolean value at bitPos in the flags.void
This is a convenience method that will convert the value to a COSFloat object.void
This is a convenience method that will convert the value to a COSFloat object.void
This is a convenience method that will convert the value to a COSInteger object.void
This is a convenience method that will convert the value to a COSInteger object.void
This will set an item in the dictionary.void
setItem
(String key, COSObjectable value) This will set an item in the dictionary.void
This will set an item in the dictionary.void
setItem
(COSName key, COSObjectable value) This will set an item in the dictionary.void
This is a convenience method that will convert the value to a COSInteger object.void
This is a convenience method that will convert the value to a COSInteger object.void
This is a convenience method that will convert the value to a COSName object.void
This is a convenience method that will convert the value to a COSName object.void
setNeedToBeUpdated
(boolean flag) Set the update state of the dictionary for the COSWriter.void
This is a convenience method that will convert the value to a COSString object.void
This is a convenience method that will convert the value to a COSString object.Methods inherited from class org.apache.pdfbox.cos.COSDictionary
accept, asUnmodifiableDictionary, containsKey, containsKey, containsValue, entrySet, getBoolean, getBoolean, getBoolean, getCOSArray, getCOSDictionary, getCOSName, getCOSName, getCOSObject, getCOSStream, getDate, getDate, getDate, getDate, getDictionaryObject, getDictionaryObject, getDictionaryObject, getDictionaryObject, getEmbeddedDate, getEmbeddedDate, getEmbeddedDate, getEmbeddedDate, getEmbeddedInt, getEmbeddedInt, getEmbeddedInt, getEmbeddedInt, getEmbeddedString, getEmbeddedString, getEmbeddedString, getEmbeddedString, getFlag, getFloat, getFloat, getFloat, getFloat, getInt, getInt, getInt, getInt, getInt, getInt, getInt, getItem, getItem, getItem, getKeyForValue, getLong, getLong, getLong, getLong, getLong, getNameAsString, getNameAsString, getNameAsString, getNameAsString, getObjectFromPath, getString, getString, getString, getString, getValues, isNeedToBeUpdated, keySet, size, toString
Methods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, isDirect, setDirect
-
Constructor Details
-
UnmodifiableCOSDictionary
UnmodifiableCOSDictionary(COSDictionary dict)
-
-
Method Details
-
clear
public void clear()This will clear all items in the map.- Overrides:
clear
in classCOSDictionary
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItem
in classCOSDictionary
- Parameters:
key
- The key to the dictionary object.value
- The value to the dictionary object.
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItem
in classCOSDictionary
- Parameters:
key
- The key to the dictionary object.value
- The value to the dictionary object.
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItem
in classCOSDictionary
- Parameters:
key
- The key to the dictionary object.value
- The value to the dictionary object.
-
setBoolean
This will set an item in the dictionary.- Overrides:
setBoolean
in classCOSDictionary
- Parameters:
key
- The key to the dictionary object.value
- The value to the dictionary object.
-
setBoolean
This will set an item in the dictionary.- Overrides:
setBoolean
in classCOSDictionary
- Parameters:
key
- The key to the dictionary object.value
- The value to the dictionary object.
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItem
in classCOSDictionary
- Parameters:
key
- The key to the dictionary object.value
- The value to the dictionary object.
-
setName
This is a convenience method that will convert the value to a COSName object. If it is null then the object will be removed.- Overrides:
setName
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The string value for the name.
-
setName
This is a convenience method that will convert the value to a COSName object. If it is null then the object will be removed.- Overrides:
setName
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The string value for the name.
-
setDate
Set the value of a date entry in the dictionary.- Overrides:
setDate
in classCOSDictionary
- Parameters:
key
- The key to the date value.date
- The date value.
-
setDate
Set the date object.- Overrides:
setDate
in classCOSDictionary
- Parameters:
key
- The key to the date.date
- The date to set.
-
setEmbeddedDate
Set the value of a date entry in the dictionary.- Overrides:
setEmbeddedDate
in classCOSDictionary
- Parameters:
embedded
- The embedded dictionary.key
- The key to the date value.date
- The date value.
-
setEmbeddedDate
Set the date object.- Overrides:
setEmbeddedDate
in classCOSDictionary
- Parameters:
embedded
- The embedded dictionary.key
- The key to the date.date
- The date to set.
-
setString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setString
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The string value for the name.
-
setString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setString
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The string value for the name.
-
setEmbeddedString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setEmbeddedString
in classCOSDictionary
- Parameters:
embedded
- The embedded dictionary to set the item in.key
- The key to the object,value
- The string value for the name.
-
setEmbeddedString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setEmbeddedString
in classCOSDictionary
- Parameters:
embedded
- The embedded dictionary to set the item in.key
- The key to the object,value
- The string value for the name.
-
setInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setInt
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The int value for the name.
-
setInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setInt
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The int value for the name.
-
setLong
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setLong
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The int value for the name.
-
setLong
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setLong
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The int value for the name.
-
setEmbeddedInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setEmbeddedInt
in classCOSDictionary
- Parameters:
embeddedDictionary
- The embedded dictionary.key
- The key to the object,value
- The int value for the name.
-
setEmbeddedInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setEmbeddedInt
in classCOSDictionary
- Parameters:
embeddedDictionary
- The embedded dictionary.key
- The key to the object,value
- The int value for the name.
-
setFloat
This is a convenience method that will convert the value to a COSFloat object.- Overrides:
setFloat
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The int value for the name.
-
setFloat
This is a convenience method that will convert the value to a COSFloat object.- Overrides:
setFloat
in classCOSDictionary
- Parameters:
key
- The key to the object,value
- The int value for the name.
-
removeItem
This will remove an item for the dictionary. This will do nothing of the object does not exist.- Overrides:
removeItem
in classCOSDictionary
- Parameters:
key
- The key to the item to remove from the dictionary.
-
addAll
This will add all of the dictionaries keys/values to this dictionary. Existing key/value pairs will be overwritten.- Overrides:
addAll
in classCOSDictionary
- Parameters:
dic
- The dictionaries to get the key/value pairs from.
-
mergeInto
This will add all of the dictionaries keys/values to this dictionary, but only if they don't already exist. If a key already exists in this dictionary then nothing is changed.- Overrides:
mergeInto
in classCOSDictionary
- Parameters:
dic
- The dictionaries to get the keys from.
-
setFlag
Sets the given boolean value at bitPos in the flags.- Overrides:
setFlag
in classCOSDictionary
- Parameters:
field
- The COSName of the field to set the value into.bitFlag
- the bit position to set the value in.value
- the value the bit position should have.
-
setNeedToBeUpdated
public void setNeedToBeUpdated(boolean flag) Set the update state of the dictionary for the COSWriter. This indicates whether an object is to be written when there is an incremental save.- Specified by:
setNeedToBeUpdated
in interfaceCOSUpdateInfo
- Overrides:
setNeedToBeUpdated
in classCOSDictionary
- Parameters:
flag
- the update state.
-