Package org.apache.pdfbox.cos
Class COSBase
java.lang.Object
org.apache.pdfbox.cos.COSBase
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
COSArray,COSBoolean,COSDictionary,COSDocument,COSName,COSNull,COSNumber,COSObject,COSString
The base object that all objects in the PDF document will extend.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaccept(ICOSVisitor visitor) visitor pattern double dispatch method.Convert this standard java object to a COS object.getKey()This will return the COSObjectKey of an indirect object.booleanisDirect()If the state is set true, the dictionary will be written direct into the called object.voidsetDirect(boolean direct) Set the state true, if the dictionary should be written as a direct object and not indirect.voidsetKey(COSObjectKey key) Set the COSObjectKey of an indirect object.
-
Field Details
-
direct
private boolean direct -
key
-
-
Constructor Details
-
COSBase
public COSBase()Constructor.
-
-
Method Details
-
getCOSObject
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
accept
visitor pattern double dispatch method.- Parameters:
visitor- The object to notify when visiting this object.- Throws:
IOException- If an error occurs while visiting this object.
-
isDirect
public boolean isDirect()If the state is set true, the dictionary will be written direct into the called object. This means, no indirect object will be created.- Returns:
- the state
-
setDirect
public void setDirect(boolean direct) Set the state true, if the dictionary should be written as a direct object and not indirect.- Parameters:
direct- set it true, for writing direct object
-
getKey
This will return the COSObjectKey of an indirect object.- Returns:
- the COSObjectKey
-
setKey
Set the COSObjectKey of an indirect object.- Parameters:
key- the COSObjectKey of the indirect object
-