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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate COSBaseprivate booleanprivate static final org.apache.commons.logging.Logprivate ICOSParserprivate final COSUpdateState -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.COSObject(COSBase object, COSObjectKey objectKey) Constructor.COSObject(COSBase object, ICOSParser parser) Constructor.COSObject(COSObjectKey key, ICOSParser parser) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ICOSVisitor visitor) visitor pattern double dispatch method.intDeprecated.will be removed in 4.0.0This will get the object that this object encapsulates.longDeprecated.will be removed in 4.0.0Returns the currentCOSUpdateStateof thisCOSObject.booleanReturnstrue, if the hereby referencedCOSBasehas already been parsed and loaded.booleanIndicates if the referenced object is present or not.final voidSets the referenced object to COSNull and removes the initially assigned parser.toString()Methods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, getKey, isDirect, setDirect, setKeyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.pdfbox.pdmodel.common.COSObjectable
getCOSObjectMethods inherited from interface org.apache.pdfbox.cos.COSUpdateInfo
isNeedToBeUpdated, setNeedToBeUpdated, toIncrement
-
Field Details
-
baseObject
-
parser
-
isDereferenced
private boolean isDereferenced -
updateState
-
LOG
private static final org.apache.commons.logging.Log LOG
-
-
Constructor Details
-
COSObject
Constructor.- Parameters:
object- The object that this encapsulates.
-
COSObject
Constructor.- Parameters:
object- The object that this encapsulates.objectKey- The COSObjectKey of the encapsulated object
-
COSObject
Constructor.- Parameters:
object- The object that this encapsulates.parser- The parser to be used to load the object on demand
-
COSObject
Constructor.- Parameters:
key- The object number of the encapsulated object.parser- The parser to be used to load the object on demand
-
-
Method Details
-
isObjectNull
public boolean isObjectNull()Indicates if the referenced object is present or not.- Returns:
- true if the indirect object is dereferenced
-
getObject
This will get the object that this object encapsulates.- Returns:
- The encapsulated object.
-
setToNull
public final void setToNull()Sets the referenced object to COSNull and removes the initially assigned parser. -
toString
-
getObjectNumber
Deprecated.will be removed in 4.0.0Getter for property objectNumber.- Returns:
- Value of property objectNumber.
-
getGenerationNumber
Deprecated.will be removed in 4.0.0Getter for property generationNumber.- Returns:
- Value of property generationNumber.
-
accept
visitor pattern double dispatch method.- Specified by:
acceptin classCOSBase- Parameters:
visitor- The object to notify when visiting this object.- Throws:
IOException- If an error occurs while visiting this object.
-
isDereferenced
public boolean isDereferenced()Returnstrue, if the hereby referencedCOSBasehas already been parsed and loaded.- Returns:
true, if the hereby referencedCOSBasehas already been parsed and loaded.
-
getUpdateState
Returns the currentCOSUpdateStateof thisCOSObject.- Specified by:
getUpdateStatein interfaceCOSUpdateInfo- Returns:
- The current
COSUpdateStateof thisCOSObject. - See Also:
-