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
public class COSObject extends COSBase implements COSUpdateInfo
This class represents a PDF object.
-
-
Field Summary
Fields Modifier and Type Field Description private COSBasebaseObjectprivate booleanisDereferencedprivate static org.apache.commons.logging.LogLOGprivate ICOSParserparserprivate COSUpdateStateupdateState
-
Constructor Summary
Constructors Constructor Description COSObject(COSBase object)Constructor.COSObject(COSBase object, COSObjectKey objectKey)Constructor.COSObject(COSBase object, ICOSParser parser)Constructor.COSObject(COSObjectKey key, ICOSParser parser)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(ICOSVisitor visitor)visitor pattern double dispatch method.intgetGenerationNumber()Deprecated.will be removed in 4.0.0COSBasegetObject()This will get the object that this object encapsulates.longgetObjectNumber()Deprecated.will be removed in 4.0.0COSUpdateStategetUpdateState()Returns the currentCOSUpdateStateof thisCOSObject.booleanisDereferenced()Returnstrue, if the hereby referencedCOSBasehas already been parsed and loaded.booleanisObjectNull()Indicates if the referenced object is present or not.voidsetToNull()Sets the referenced object to COSNull and removes the initially assigned parser.java.lang.StringtoString()-
Methods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, getKey, isDirect, setDirect, setKey
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.pdfbox.pdmodel.common.COSObjectable
getCOSObject
-
Methods inherited from interface org.apache.pdfbox.cos.COSUpdateInfo
isNeedToBeUpdated, setNeedToBeUpdated, toIncrement
-
-
-
-
Field Detail
-
baseObject
private COSBase baseObject
-
parser
private ICOSParser parser
-
isDereferenced
private boolean isDereferenced
-
updateState
private final COSUpdateState updateState
-
LOG
private static final org.apache.commons.logging.Log LOG
-
-
Constructor Detail
-
COSObject
public COSObject(COSBase object)
Constructor.- Parameters:
object- The object that this encapsulates.
-
COSObject
public COSObject(COSBase object, COSObjectKey objectKey)
Constructor.- Parameters:
object- The object that this encapsulates.objectKey- The COSObjectKey of the encapsulated object
-
COSObject
public COSObject(COSBase object, ICOSParser parser)
Constructor.- Parameters:
object- The object that this encapsulates.parser- The parser to be used to load the object on demand
-
COSObject
public COSObject(COSObjectKey key, ICOSParser parser)
Constructor.- Parameters:
key- The object number of the encapsulated object.parser- The parser to be used to load the object on demand
-
-
Method Detail
-
isObjectNull
public boolean isObjectNull()
Indicates if the referenced object is present or not.- Returns:
- true if the indirect object is dereferenced
-
getObject
public COSBase 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getObjectNumber
@Deprecated public long getObjectNumber()
Deprecated.will be removed in 4.0.0Getter for property objectNumber.- Returns:
- Value of property objectNumber.
-
getGenerationNumber
@Deprecated public int getGenerationNumber()
Deprecated.will be removed in 4.0.0Getter for property generationNumber.- Returns:
- Value of property generationNumber.
-
accept
public void accept(ICOSVisitor visitor) throws java.io.IOException
visitor pattern double dispatch method.
-
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
public COSUpdateState getUpdateState()
Returns the currentCOSUpdateStateof thisCOSObject.- Specified by:
getUpdateStatein interfaceCOSUpdateInfo- Returns:
- The current
COSUpdateStateof thisCOSObject. - See Also:
COSUpdateState
-
-