Class COSBase

java.lang.Object
org.sejda.sambox.cos.COSBase
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
COSArray, COSBoolean, COSDictionary, COSDocument, COSName, COSNull, COSNumber, COSString, DirectCOSObject, ExistingIndirectCOSObject, IndirectCOSObject, IndirectCOSObjectReference

public abstract class COSBase extends Object implements COSObjectable
The base object that all objects in the PDF document will extend.
Author:
Ben Litchfield
  • Constructor Details

    • COSBase

      public COSBase()
  • Method Details

    • getCOSObject

      public COSBase getCOSObject()
      Convert this standard java object to a COS object.
      Specified by:
      getCOSObject in interface COSObjectable
      Returns:
      The cos object that matches this Java object.
    • accept

      public abstract void accept(COSVisitor visitor) throws IOException
      Visitor pattern for the COS model objects
      Parameters:
      visitor -
      Throws:
      IOException
    • id

      Returns:
      an identifier that can be used to identify this COSBase.
    • idIfAbsent

      public void idIfAbsent(IndirectCOSObjectIdentifier id)
      Assign an id to this COSBase if it doesn't have one already.
      Parameters:
      id -
    • hasId

      public boolean hasId()
      Returns:
      true if the COSBase has an id assigned to it