Class PDStructureNode

    • Constructor Detail

      • PDStructureNode

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

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

      • 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
      • getCOSObject

        public COSDictionary 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 java.lang.String getType()
        Returns the type.
        Returns:
        the type
      • getKids

        public java.util.List<java.lang.Object> getKids()
        Returns a list of objects for the kids (K).
        Returns:
        a list of objects for the kids, never null.
      • setKids

        public void setKids​(java.util.List<java.lang.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,
                                 java.lang.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,
                                              java.lang.Object refKid)
        Inserts an objectable kid before a reference kid.
        Parameters:
        newKid - the objectable
        refKid - the reference kid
      • insertBefore

        protected void insertBefore​(COSBase newKid,
                                    java.lang.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