Module org.sejda.sambox
Class PDStructureNode
java.lang.Object
org.sejda.sambox.pdmodel.documentinterchange.logicalstructure.PDStructureNode
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDStructureElement,PDStructureTreeRoot
A node in the structure tree.
- Author:
- Johannes Koch
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPDStructureNode(String type) Constructor.protectedPDStructureNode(COSDictionary dictionary) Constructor for an existing structure node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAppends a COS base kid.voidappendKid(PDStructureElement structureElement) Appends a structure element kid.protected voidappendObjectableKid(COSObjectable objectable) Appends an objectable kid.static PDStructureNodecreate(COSDictionary node) Creates a node in the structure tree.protected ObjectcreateObject(COSBase kid) Creates an object for a kid of this structure node.getKids()Returns a list of objects for the kids (K).getType()Returns the type.protected voidinsertBefore(COSBase newKid, Object refKid) Inserts an COS base kid before a reference kid.voidinsertBefore(PDStructureElement newKid, Object refKid) Inserts a structure element kid before a reference kid.protected voidinsertObjectableBefore(COSObjectable newKid, Object refKid) Inserts an objectable kid before a reference kid.protected booleanRemoves a COS base kid.booleanremoveKid(PDStructureElement structureElement) Removes a structure element kid.protected booleanremoveObjectableKid(COSObjectable objectable) Removes an objectable kid.voidSets the kids (K).
-
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
- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The
COSBasethat 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
-
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:
trueif the kid was removed,falseotherwise
-
removeObjectableKid
Removes an objectable kid.- Parameters:
objectable- the objectable- Returns:
trueif the kid was removed,falseotherwise
-
removeKid
Removes a COS base kid.- Parameters:
object- the COS base- Returns:
trueif the kid was removed,falseotherwise
-
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
-