Top Description Fields Constructors Methods
org.apache.pdfbox.cos

public Class COSObject

extends COSBase
implements COSUpdateInfo
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.cos.COSUpdateInfo, org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
java.io.IOException, org.apache.commons.logging.Log, .LogFactory

This class represents a PDF object.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private COSBase
private boolean
private static final Log
private ICOSParser
private final COSUpdateState

Constructor Summary

AccessConstructor and Description
public
COSObject(COSBase
The object that this encapsulates.
object
)

Constructor.

public
COSObject(COSBase
The object that this encapsulates.
object
,
COSObjectKey
The COSObjectKey of the encapsulated object
objectKey
)

Constructor.

public
COSObject(COSBase
The object that this encapsulates.
object
,
ICOSParser
The parser to be used to load the object on demand
parser
)

Constructor.

public
COSObject(COSObjectKey
The object number of the encapsulated object.
key
,
ICOSParser
The parser to be used to load the object on demand
parser
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
accept(ICOSVisitor
The object to notify when visiting this object.
visitor
)

Implements abstract org.apache.pdfbox.cos.COSBase.accept.

visitor pattern double dispatch method.

public int

Returns:

Value of property generationNumber.
getGenerationNumber
()
Deprecated will be removed in 4.0.0

Getter for property generationNumber.

public COSBase

Returns:

The encapsulated object.
getObject
()

This will get the object that this object encapsulates.

public long

Returns:

Value of property objectNumber.
getObjectNumber
()
Deprecated will be removed in 4.0.0

Getter for property objectNumber.

public COSUpdateState

Returns:

The current COSUpdateState of this COSObject.
getUpdateState
()

Implements org.apache.pdfbox.cos.COSUpdateInfo.getUpdateState.

Returns the current COSUpdateState of this COSObject.

public boolean

Returns:

true, if the hereby referenced COSBase has already been parsed and loaded.
isDereferenced
()

Returns true, if the hereby referenced COSBase has already been parsed and loaded.

public boolean

Returns:

true if the indirect object is dereferenced
isObjectNull
()

Indicates if the referenced object is present or not.

public final void
setToNull()

Sets the referenced object to COSNull and removes the initially assigned parser.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.pdfbox.cos.COSBase:
getCOSObjectgetKeyisDirectsetDirectsetKey

Field Detail

baseObjectback to summary
private COSBase baseObject
isDereferencedback to summary
private boolean isDereferenced
LOGback to summary
private static final Log LOG
parserback to summary
private ICOSParser parser
updateStateback to summary
private final COSUpdateState updateState

Constructor Detail

COSObjectback to summary
public COSObject(COSBase object)

Constructor.

Parameters
object:COSBase

The object that this encapsulates.

COSObjectback to summary
public COSObject(COSBase object, COSObjectKey objectKey)

Constructor.

Parameters
object:COSBase

The object that this encapsulates.

objectKey:COSObjectKey

The COSObjectKey of the encapsulated object

COSObjectback to summary
public COSObject(COSBase object, ICOSParser parser)

Constructor.

Parameters
object:COSBase

The object that this encapsulates.

parser:ICOSParser

The parser to be used to load the object on demand

COSObjectback to summary
public COSObject(COSObjectKey key, ICOSParser parser)

Constructor.

Parameters
key:COSObjectKey

The object number of the encapsulated object.

parser:ICOSParser

The parser to be used to load the object on demand

Method Detail

acceptback to summary
public void accept(ICOSVisitor visitor) throws IOException

Implements abstract org.apache.pdfbox.cos.COSBase.accept.

visitor pattern double dispatch method.

Parameters
visitor:ICOSVisitor

The object to notify when visiting this object.

Annotations
@Override
Exceptions
IOException:
If an error occurs while visiting this object.
getGenerationNumberback to summary
public int getGenerationNumber()

Deprecated

will be removed in 4.0.0

Getter for property generationNumber.

Returns:int

Value of property generationNumber.

Annotations
@Deprecated
getObjectback to summary
public COSBase getObject()

This will get the object that this object encapsulates.

Returns:COSBase

The encapsulated object.

getObjectNumberback to summary
public long getObjectNumber()

Deprecated

will be removed in 4.0.0

Getter for property objectNumber.

Returns:long

Value of property objectNumber.

Annotations
@Deprecated
getUpdateStateback to summary
public COSUpdateState getUpdateState()

Implements org.apache.pdfbox.cos.COSUpdateInfo.getUpdateState.

Returns the current COSUpdateState of this COSObject.

Returns:COSUpdateState

The current COSUpdateState of this COSObject.

Annotations
@Override
See Also
COSUpdateState
isDereferencedback to summary
public boolean isDereferenced()

Returns true, if the hereby referenced COSBase has already been parsed and loaded.

Returns:boolean

true, if the hereby referenced COSBase has already been parsed and loaded.

isObjectNullback to summary
public boolean isObjectNull()

Indicates if the referenced object is present or not.

Returns:boolean

true if the indirect object is dereferenced

setToNullback to summary
public final void setToNull()

Sets the referenced object to COSNull and removes the initially assigned parser.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override