Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure

public abstract Class PDStructureNode

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Known Direct Subclasses
org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureTreeRoot, org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureElement
Imports
java.util.ArrayList, .List, org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSInteger, .COSName, .COSObject, org.apache.pdfbox.pdmodel.common.COSArrayList, .COSObjectable

A node in the structure tree.
Author
Johannes Koch

Field Summary

Modifier and TypeField and Description
private final COSDictionary

Constructor Summary

AccessConstructor and Description
protected
PDStructureNode(String
the type
type
)

Constructor.

protected
PDStructureNode(COSDictionary
The existing dictionary.
dictionary
)

Constructor for an existing structure node.

Method Summary

Modifier and TypeMethod and Description
public void
appendKid(PDStructureElement
the structure element
structureElement
)

Appends a structure element kid and sets the parent property (/P) to this.

protected void
appendKid(COSBase
the COS base
object
)

Appends a COS base kid.

protected void
appendObjectableKid(COSObjectable
the objectable
objectable
)

Appends an objectable kid.

public static PDStructureNode

Returns:

the structure node
create
(COSDictionary
the node dictionary
node
)

Creates a node in the structure tree.

protected Object

Returns:

the object
createObject
(COSBase
the kid
kid
)

Creates an object for a kid of this structure node.

private COSObjectable
public COSDictionary
getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

public List<Object>

Returns:

a list of objects for the kids, never null.
getKids
()

Returns a list of objects for the kids (K).

public String

Returns:

the type
getType
()

Returns the type.

public void
insertBefore(PDStructureElement
the structure element
newKid
,
Object
the reference kid
refKid
)

Inserts a structure element kid before a reference kid.

protected void
insertBefore(COSBase
the COS base
newKid
,
Object
the reference kid
refKid
)

Inserts an COS base kid before a reference kid.

protected void
insertObjectableBefore(COSObjectable
the objectable
newKid
,
Object
the reference kid
refKid
)

Inserts an objectable kid before a reference kid.

public boolean

Returns:

true if the kid was removed, false otherwise.
removeKid
(PDStructureElement
the structure element
structureElement
)

Removes a structure element kid and if successful also removes the parent property (/P).

protected boolean

Returns:

true if the kid was removed, false otherwise
removeKid
(COSBase
the COS base
object
)

Removes a COS base kid.

protected boolean

Returns:

true if the kid was removed, false otherwise
removeObjectableKid
(COSObjectable
the objectable
objectable
)

Removes an objectable kid.

public void
setKids(List<Object>
the kids
kids
)

Sets the kids (K).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dictionaryback to summary
private final COSDictionary dictionary

Constructor Detail

PDStructureNodeback to summary
protected PDStructureNode(String type)

Constructor.

Parameters
type:String

the type

PDStructureNodeback to summary
protected PDStructureNode(COSDictionary dictionary)

Constructor for an existing structure node.

Parameters
dictionary:COSDictionary

The existing dictionary.

Method Detail

appendKidback to summary
public void appendKid(PDStructureElement structureElement)

Appends a structure element kid and sets the parent property (/P) to this.

Parameters
structureElement:PDStructureElement

the structure element

appendKidback to summary
protected void appendKid(COSBase object)

Appends a COS base kid.

Parameters
object:COSBase

the COS base

appendObjectableKidback to summary
protected void appendObjectableKid(COSObjectable objectable)

Appends an objectable kid.

Parameters
objectable:COSObjectable

the objectable

createback to summary
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:COSDictionary

the node dictionary

Returns:PDStructureNode

the structure node

createObjectback to summary
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:COSBase

the kid

Returns:Object

the object

createObjectFromDicback to summary
private COSObjectable createObjectFromDic(COSDictionary kidDic)
getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Doc from org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

Returns:COSDictionary

The cos object that matches this Java object.

Annotations
@Override
getKidsback to summary
public List<Object> getKids()

Returns a list of objects for the kids (K).

Returns:List<Object>

a list of objects for the kids, never null.

getTypeback to summary
public String getType()

Returns the type.

Returns:String

the type

insertBeforeback to summary
public void insertBefore(PDStructureElement newKid, Object refKid)

Inserts a structure element kid before a reference kid.

Parameters
newKid:PDStructureElement

the structure element

refKid:Object

the reference kid

insertBeforeback to summary
protected void insertBefore(COSBase newKid, Object refKid)

Inserts an COS base kid before a reference kid.

Parameters
newKid:COSBase

the COS base

refKid:Object

the reference kid

insertObjectableBeforeback to summary
protected void insertObjectableBefore(COSObjectable newKid, Object refKid)

Inserts an objectable kid before a reference kid.

Parameters
newKid:COSObjectable

the objectable

refKid:Object

the reference kid

removeKidback to summary
public boolean removeKid(PDStructureElement structureElement)

Removes a structure element kid and if successful also removes the parent property (/P).

Parameters
structureElement:PDStructureElement

the structure element

Returns:boolean

true if the kid was removed, false otherwise.

removeKidback to summary
protected boolean removeKid(COSBase object)

Removes a COS base kid.

Parameters
object:COSBase

the COS base

Returns:boolean

true if the kid was removed, false otherwise

removeObjectableKidback to summary
protected boolean removeObjectableKid(COSObjectable objectable)

Removes an objectable kid.

Parameters
objectable:COSObjectable

the objectable

Returns:boolean

true if the kid was removed, false otherwise

setKidsback to summary
public void setKids(List<Object> kids)

Sets the kids (K).

Parameters
kids:List<Object>

the kids