Package org.apache.pdfbox.cos
Class COSObject
java.lang.Object
org.apache.pdfbox.cos.COSBase
org.apache.pdfbox.cos.COSObject
- All Implemented Interfaces:
COSUpdateInfo
,COSObjectable
This class represents a PDF object.
- Author:
- Ben Litchfield
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept
(ICOSVisitor visitor) visitor pattern double dispatch method.This will get the dictionary object in this object that has the name key and if it is a pdfobjref then it will dereference that and return it.int
Getter for property generationNumber.This will get the dictionary object in this object that has the name key.This will get the object that this object encapsulates.long
Getter for property objectNumber.boolean
Get the update state for the COSWriter.void
setGenerationNumber
(int generationNumberValue) Setter for property generationNumber.void
setNeedToBeUpdated
(boolean flag) Set the update state of the dictionary for the COSWriter.final void
This will set the object that this object encapsulates.void
setObjectNumber
(long objectNum) Setter for property objectNumber.toString()
Methods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, isDirect, setDirect
-
Constructor Details
-
COSObject
Constructor.- Parameters:
object
- The object that this encapsulates.- Throws:
IOException
- If there is an error with the object passed in.
-
-
Method Details
-
getDictionaryObject
This will get the dictionary object in this object that has the name key and if it is a pdfobjref then it will dereference that and return it.- Parameters:
key
- The key to the value that we are searching for.- Returns:
- The pdf object that matches the key.
-
getItem
This will get the dictionary object in this object that has the name key.- Parameters:
key
- The key to the value that we are searching for.- Returns:
- The pdf object that matches the key.
-
getObject
This will get the object that this object encapsulates.- Returns:
- The encapsulated object.
-
setObject
This will set the object that this object encapsulates.- Parameters:
object
- The new object to encapsulate.- Throws:
IOException
- If there is an error setting the updated object.
-
toString
-
getObjectNumber
public long getObjectNumber()Getter for property objectNumber.- Returns:
- Value of property objectNumber.
-
setObjectNumber
public void setObjectNumber(long objectNum) Setter for property objectNumber.- Parameters:
objectNum
- New value of property objectNumber.
-
getGenerationNumber
public int getGenerationNumber()Getter for property generationNumber.- Returns:
- Value of property generationNumber.
-
setGenerationNumber
public void setGenerationNumber(int generationNumberValue) Setter for property generationNumber.- Parameters:
generationNumberValue
- New value of property generationNumber.
-
accept
visitor pattern double dispatch method.- Specified by:
accept
in classCOSBase
- Parameters:
visitor
- The object to notify when visiting this object.- Returns:
- any object, depending on the visitor implementation, or null
- Throws:
IOException
- If an error occurs while visiting this object.
-
isNeedToBeUpdated
public boolean isNeedToBeUpdated()Get the update state for the COSWriter.- Specified by:
isNeedToBeUpdated
in interfaceCOSUpdateInfo
- Returns:
- the update state.
-
setNeedToBeUpdated
public void setNeedToBeUpdated(boolean flag) Set the update state of the dictionary for the COSWriter.- Specified by:
setNeedToBeUpdated
in interfaceCOSUpdateInfo
- Parameters:
flag
- the update state.
-