java.lang.Object
org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureNode
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
PDStructureElement, PDStructureTreeRoot

public abstract class PDStructureNode extends Object implements COSObjectable
A node in the structure tree.
Version:
$Revision: $
Author:
Koch
  • Constructor Details

    • PDStructureNode

      protected PDStructureNode(String type)
      Constructor.
      Parameters:
      type - the type
    • PDStructureNode

      protected PDStructureNode(COSDictionary dictionary)
      Constructor for an existing structure node.
      Parameters:
      dictionary - The existing dictionary.
  • Method Details

    • create

      public static PDStructureNode create(COSDictionary node)
      Creates a node in the structure tree. Can be either a structure tree root, or a structure element.
      Parameters:
      node - the node dictionary
      Returns:
      the structure node
    • getCOSDictionary

      protected COSDictionary getCOSDictionary()
    • 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.
    • getType

      public String getType()
      Returns the type.
      Returns:
      the type
    • getKids

      public List<Object> getKids()
      Returns a list of objects for the kids (K).
      Returns:
      a list of objects for the kids
    • setKids

      public void setKids(List<Object> kids)
      Sets the kids (K).
      Parameters:
      kids - the kids
    • appendKid

      public void appendKid(PDStructureElement structureElement)
      Appends a structure element kid.
      Parameters:
      structureElement - the structure element
    • appendObjectableKid

      protected void appendObjectableKid(COSObjectable objectable)
      Appends an objectable kid.
      Parameters:
      objectable - the objectable
    • appendKid

      protected void appendKid(COSBase object)
      Appends a COS base kid.
      Parameters:
      object - the COS base
    • insertBefore

      public void insertBefore(PDStructureElement newKid, Object refKid)
      Inserts a structure element kid before a reference kid.
      Parameters:
      newKid - the structure element
      refKid - the reference kid
    • insertObjectableBefore

      protected void insertObjectableBefore(COSObjectable newKid, Object refKid)
      Inserts an objectable kid before a reference kid.
      Parameters:
      newKid - the objectable
      refKid - the reference kid
    • insertBefore

      protected void insertBefore(COSBase newKid, Object refKid)
      Inserts an COS base kid before a reference kid.
      Parameters:
      newKid - the COS base
      refKid - the reference kid
    • removeKid

      public boolean removeKid(PDStructureElement structureElement)
      Removes a structure element kid.
      Parameters:
      structureElement - the structure element
      Returns:
      true if the kid was removed, false otherwise
    • removeObjectableKid

      protected boolean removeObjectableKid(COSObjectable objectable)
      Removes an objectable kid.
      Parameters:
      objectable - the objectable
      Returns:
      true if the kid was removed, false otherwise
    • removeKid

      protected boolean removeKid(COSBase object)
      Removes a COS base kid.
      Parameters:
      object - the COS base
      Returns:
      true if the kid was removed, false otherwise
    • createObject

      protected Object createObject(COSBase kid)
      Creates an object for a kid of this structure node. The type of object depends on the type of the kid. It can be
      Parameters:
      kid - the kid
      Returns:
      the object