Class PDStructureNode
java.lang.Object
org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureNode
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDStructureElement
,PDStructureTreeRoot
A node in the structure tree.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PDStructureNode
(String type) Constructor.protected
PDStructureNode
(COSDictionary dictionary) Constructor for an existing structure node. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Appends a COS base kid.void
appendKid
(PDStructureElement structureElement) Appends a structure element kid.protected void
appendObjectableKid
(COSObjectable objectable) Appends an objectable kid.static PDStructureNode
create
(COSDictionary node) Creates a node in the structure tree.protected Object
createObject
(COSBase kid) Creates an object for a kid of this structure node.private COSObjectable
createObjectFromDic
(COSDictionary kidDic) Convert this standard java object to a COS object.getKids()
Returns a list of objects for the kids (K).getType()
Returns the type.protected void
insertBefore
(COSBase newKid, Object refKid) Inserts an COS base kid before a reference kid.void
insertBefore
(PDStructureElement newKid, Object refKid) Inserts a structure element kid before a reference kid.protected void
insertObjectableBefore
(COSObjectable newKid, Object refKid) Inserts an objectable kid before a reference kid.protected boolean
Removes a COS base kid.boolean
removeKid
(PDStructureElement structureElement) Removes a structure element kid.protected boolean
removeObjectableKid
(COSObjectable objectable) Removes an objectable kid.void
Sets the kids (K).
-
Field Details
-
dictionary
-
-
Constructor Details
-
PDStructureNode
Constructor.- Parameters:
type
- the type
-
PDStructureNode
Constructor for an existing structure node.- Parameters:
dictionary
- The existing dictionary.
-
-
Method Details
-
create
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
Convert this standard java object to a COS object.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Returns:
- The cos object that matches this Java object.
-
getType
Returns the type.- Returns:
- the type
-
getKids
Returns a list of objects for the kids (K).- Returns:
- a list of objects for the kids, never null.
-
setKids
Sets the kids (K).- Parameters:
kids
- the kids
-
appendKid
Appends a structure element kid.- Parameters:
structureElement
- the structure element
-
appendObjectableKid
Appends an objectable kid.- Parameters:
objectable
- the objectable
-
appendKid
Appends a COS base kid.- Parameters:
object
- the COS base
-
insertBefore
Inserts a structure element kid before a reference kid.- Parameters:
newKid
- the structure elementrefKid
- the reference kid
-
insertObjectableBefore
Inserts an objectable kid before a reference kid.- Parameters:
newKid
- the objectablerefKid
- the reference kid
-
insertBefore
Inserts an COS base kid before a reference kid.- Parameters:
newKid
- the COS baserefKid
- the reference kid
-
removeKid
Removes a structure element kid.- Parameters:
structureElement
- the structure element- Returns:
true
if the kid was removed,false
otherwise
-
removeObjectableKid
Removes an objectable kid.- Parameters:
objectable
- the objectable- Returns:
true
if the kid was removed,false
otherwise
-
removeKid
Removes a COS base kid.- Parameters:
object
- the COS base- Returns:
true
if the kid was removed,false
otherwise
-
createObject
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
-
createObjectFromDic
-