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

public Class PDStructureElement

extends PDStructureNode
Class Inheritance
Imports
java.util.Collections, .Iterator, .Map, org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSInteger, .COSName, .COSNumber, .COSObject, org.apache.pdfbox.pdmodel.PDPage, org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDMarkedContent, org.apache.pdfbox.pdmodel.documentinterchange.taggedpdf.StandardStructureTypes

A structure element.
Authors
Ben Litchfield, Johannes Koch

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public
PDStructureElement(String
The structure type. Constants are available in the StandardStructureTypes class.
structureType
,
PDStructureNode
The parent structure node.
parent
)

Constructor with required values.

public
PDStructureElement(COSDictionary
The existing dictionary.
dic
)

Constructor for an existing structure element.

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(PDAttributeObject
the attribute object
attributeObject
)

Adds an attribute object.

public void
addClassName(String
the class name
className
)

Adds a class name.

public void
appendKid(int
the marked-content id (MCID).
mcid
)

Appends a marked-content sequence kid.

public void
appendKid(PDMarkedContent
the marked-content sequence with the MCID.
markedContent
)

Appends a marked-content sequence kid.

public void
appendKid(PDMarkedContentReference
the marked-content reference
markedContentReference
)

Appends a marked-content reference kid.

public void
appendKid(PDObjectReference
the object reference
objectReference
)

Appends an object reference kid.

public void
attributeChanged(PDAttributeObject
the attribute object
attributeObject
)

Updates the revision number for the given attribute object.

public String

Returns:

the actual text
getActualText
()

Returns the actual text (ActualText).

public String

Returns:

the alternate description
getAlternateDescription
()

Returns the alternate description (Alt).

public Revisions<PDAttributeObject>

Returns:

the attributes as a list, never null.
getAttributes
()

Returns the attributes together with their revision numbers (A).

public Revisions<String>

Returns:

the class names as a list, never null.
getClassNames
()

Returns the class names together with their revision numbers (C).

public String

Returns:

the element identifier
getElementIdentifier
()

Returns the element identifier (ID).

public String

Returns:

the expanded form
getExpandedForm
()

Returns the expanded form (E).

public String

Returns:

the language
getLanguage
()

Returns the language (Lang).

public PDPage

Returns:

the page on which some or all of the content items designated by the K entry shall be rendered
getPage
()

Returns the page on which some or all of the content items designated by the K entry shall be rendered (Pg).

public PDStructureNode

Returns:

the parent in the structure hierarchy
getParent
()

Returns the parent in the structure hierarchy (P).

public int

Returns:

the revision number
getRevisionNumber
()

Returns the revision number (R).

private Map<String, Object>

Returns:

the role map
getRoleMap
()

Returns the role map.

public String

Returns:

the standard structure type
getStandardStructureType
()

Returns the standard structure type, the actual structure type is mapped to in the role map.

private PDStructureTreeRoot

Returns:

the structure tree root
getStructureTreeRoot
()

Returns the structure tree root.

public String

Returns:

the structure type
getStructureType
()

Returns the structure type (S).

public String

Returns:

the title
getTitle
()

Returns the title (T).

public void
incrementRevisionNumber()

Increments th revision number.

public void
insertBefore(COSInteger
the marked-content identifier
markedContentIdentifier
,
Object
the reference kid
refKid
)

Inserts a marked-content identifier kid before a reference kid.

public void
insertBefore(PDMarkedContentReference
the marked-content reference
markedContentReference
,
Object
the reference kid
refKid
)

Inserts a marked-content reference kid before a reference kid.

public void
insertBefore(PDObjectReference
the object reference
objectReference
,
Object
the reference kid
refKid
)

Inserts an object reference kid before a reference kid.

public void
removeAttribute(PDAttributeObject
the attribute object
attributeObject
)

Removes an attribute object.

public void
removeClassName(String
the class name
className
)

Removes a class name.

public void
removeKid(COSInteger
the marked-content identifier
markedContentIdentifier
)

Removes a marked-content identifier kid.

public void
removeKid(PDMarkedContentReference
the marked-content reference
markedContentReference
)

Removes a marked-content reference kid.

public void
removeKid(PDObjectReference
the object reference
objectReference
)

Removes an object reference kid.

public void
setActualText(String
the actual text
actualText
)

Sets the actual text (ActualText).

public void
setAlternateDescription(String
the alternate description
alternateDescription
)

Sets the alternate description (Alt).

public void
setAttributes(Revisions<PDAttributeObject>
the attributes
attributes
)

Sets the attributes together with their revision numbers (A).

public void
setClassNames(Revisions<String>
the class names
classNames
)

Sets the class names together with their revision numbers (C).

public void
setElementIdentifier(String
the element identifier
id
)

Sets the element identifier (ID).

public void
setExpandedForm(String
the expanded form
expandedForm
)

Sets the expanded form (E).

public void
setLanguage(String
the language
language
)

Sets the language (Lang).

public void
setPage(PDPage
the page on which some or all of the content items designated by the K entry shall be rendered.
page
)

Sets the page on which some or all of the content items designated by the K entry shall be rendered (Pg).

public final void
setParent(PDStructureNode
the parent in the structure hierarchy
structureNode
)

Sets the parent in the structure hierarchy (P).

public void
setRevisionNumber(int
the revision number
revisionNumber
)

Sets the revision number (R).

public final void
setStructureType(String
the structure type
structureType
)

Sets the structure type (S).

public void
setTitle(String
the title
title
)

Sets the title (T).

Inherited from org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureNode:
appendKidappendKidappendObjectableKidcreatecreateObjectgetCOSObjectgetKidsgetTypeinsertBeforeinsertBeforeinsertObjectableBeforeremoveKidremoveKidremoveObjectableKidsetKids

Field Detail

TYPEback to summary
public static final String TYPE

Constructor Detail

PDStructureElementback to summary
public PDStructureElement(String structureType, PDStructureNode parent)

Constructor with required values.

Parameters
structureType:String

The structure type. Constants are available in the StandardStructureTypes class.

parent:PDStructureNode

The parent structure node.

PDStructureElementback to summary
public PDStructureElement(COSDictionary dic)

Constructor for an existing structure element.

Parameters
dic:COSDictionary

The existing dictionary.

Method Detail

addAttributeback to summary
public void addAttribute(PDAttributeObject attributeObject)

Adds an attribute object.

Parameters
attributeObject:PDAttributeObject

the attribute object

addClassNameback to summary
public void addClassName(String className)

Adds a class name.

Parameters
className:String

the class name

appendKidback to summary
public void appendKid(int mcid)

Appends a marked-content sequence kid.

Parameters
mcid:int

the marked-content id (MCID).

Exceptions
IllegalArgumentException:
if the mcid is negative.
appendKidback to summary
public void appendKid(PDMarkedContent markedContent)

Appends a marked-content sequence kid.

Parameters
markedContent:PDMarkedContent

the marked-content sequence with the MCID.

Exceptions
IllegalArgumentException:
if the mcid is negative or doesn't exist.
appendKidback to summary
public void appendKid(PDMarkedContentReference markedContentReference)

Appends a marked-content reference kid.

Parameters
markedContentReference:PDMarkedContentReference

the marked-content reference

appendKidback to summary
public void appendKid(PDObjectReference objectReference)

Appends an object reference kid.

Parameters
objectReference:PDObjectReference

the object reference

attributeChangedback to summary
public void attributeChanged(PDAttributeObject attributeObject)

Updates the revision number for the given attribute object.

Parameters
attributeObject:PDAttributeObject

the attribute object

getActualTextback to summary
public String getActualText()

Returns the actual text (ActualText).

Returns:String

the actual text

getAlternateDescriptionback to summary
public String getAlternateDescription()

Returns the alternate description (Alt).

Returns:String

the alternate description

getAttributesback to summary
public Revisions<PDAttributeObject> getAttributes()

Returns the attributes together with their revision numbers (A).

Returns:Revisions<PDAttributeObject>

the attributes as a list, never null.

getClassNamesback to summary
public Revisions<String> getClassNames()

Returns the class names together with their revision numbers (C).

Returns:Revisions<String>

the class names as a list, never null.

getElementIdentifierback to summary
public String getElementIdentifier()

Returns the element identifier (ID).

Returns:String

the element identifier

getExpandedFormback to summary
public String getExpandedForm()

Returns the expanded form (E).

Returns:String

the expanded form

getLanguageback to summary
public String getLanguage()

Returns the language (Lang).

Returns:String

the language

getPageback to summary
public PDPage getPage()

Returns the page on which some or all of the content items designated by the K entry shall be rendered (Pg).

Returns:PDPage

the page on which some or all of the content items designated by the K entry shall be rendered

getParentback to summary
public PDStructureNode getParent()

Returns the parent in the structure hierarchy (P).

Returns:PDStructureNode

the parent in the structure hierarchy

getRevisionNumberback to summary
public int getRevisionNumber()

Returns the revision number (R).

Returns:int

the revision number

getRoleMapback to summary
private Map<String, Object> getRoleMap()

Returns the role map.

Returns:Map<String, Object>

the role map

getStandardStructureTypeback to summary
public String getStandardStructureType()

Returns the standard structure type, the actual structure type is mapped to in the role map.

Returns:String

the standard structure type

getStructureTreeRootback to summary
private PDStructureTreeRoot getStructureTreeRoot()

Returns the structure tree root.

Returns:PDStructureTreeRoot

the structure tree root

getStructureTypeback to summary
public String getStructureType()

Returns the structure type (S).

Returns:String

the structure type

getTitleback to summary
public String getTitle()

Returns the title (T).

Returns:String

the title

incrementRevisionNumberback to summary
public void incrementRevisionNumber()

Increments th revision number.

insertBeforeback to summary
public void insertBefore(COSInteger markedContentIdentifier, Object refKid)

Inserts a marked-content identifier kid before a reference kid.

Parameters
markedContentIdentifier:COSInteger

the marked-content identifier

refKid:Object

the reference kid

insertBeforeback to summary
public void insertBefore(PDMarkedContentReference markedContentReference, Object refKid)

Inserts a marked-content reference kid before a reference kid.

Parameters
markedContentReference:PDMarkedContentReference

the marked-content reference

refKid:Object

the reference kid

insertBeforeback to summary
public void insertBefore(PDObjectReference objectReference, Object refKid)

Inserts an object reference kid before a reference kid.

Parameters
objectReference:PDObjectReference

the object reference

refKid:Object

the reference kid

removeAttributeback to summary
public void removeAttribute(PDAttributeObject attributeObject)

Removes an attribute object.

Parameters
attributeObject:PDAttributeObject

the attribute object

removeClassNameback to summary
public void removeClassName(String className)

Removes a class name.

Parameters
className:String

the class name

removeKidback to summary
public void removeKid(COSInteger markedContentIdentifier)

Removes a marked-content identifier kid.

Parameters
markedContentIdentifier:COSInteger

the marked-content identifier

removeKidback to summary
public void removeKid(PDMarkedContentReference markedContentReference)

Removes a marked-content reference kid.

Parameters
markedContentReference:PDMarkedContentReference

the marked-content reference

removeKidback to summary
public void removeKid(PDObjectReference objectReference)

Removes an object reference kid.

Parameters
objectReference:PDObjectReference

the object reference

setActualTextback to summary
public void setActualText(String actualText)

Sets the actual text (ActualText).

Parameters
actualText:String

the actual text

setAlternateDescriptionback to summary
public void setAlternateDescription(String alternateDescription)

Sets the alternate description (Alt).

Parameters
alternateDescription:String

the alternate description

setAttributesback to summary
public void setAttributes(Revisions<PDAttributeObject> attributes)

Sets the attributes together with their revision numbers (A).

Parameters
attributes:Revisions<PDAttributeObject>

the attributes

setClassNamesback to summary
public void setClassNames(Revisions<String> classNames)

Sets the class names together with their revision numbers (C).

Parameters
classNames:Revisions<String>

the class names

setElementIdentifierback to summary
public void setElementIdentifier(String id)

Sets the element identifier (ID).

Parameters
id:String

the element identifier

setExpandedFormback to summary
public void setExpandedForm(String expandedForm)

Sets the expanded form (E).

Parameters
expandedForm:String

the expanded form

setLanguageback to summary
public void setLanguage(String language)

Sets the language (Lang).

Parameters
language:String

the language

setPageback to summary
public void setPage(PDPage page)

Sets the page on which some or all of the content items designated by the K entry shall be rendered (Pg).

Parameters
page:PDPage

the page on which some or all of the content items designated by the K entry shall be rendered.

setParentback to summary
public final void setParent(PDStructureNode structureNode)

Sets the parent in the structure hierarchy (P).

Parameters
structureNode:PDStructureNode

the parent in the structure hierarchy

setRevisionNumberback to summary
public void setRevisionNumber(int revisionNumber)

Sets the revision number (R).

Parameters
revisionNumber:int

the revision number

setStructureTypeback to summary
public final void setStructureType(String structureType)

Sets the structure type (S).

Parameters
structureType:String

the structure type

setTitleback to summary
public void setTitle(String title)

Sets the title (T).

Parameters
title:String

the title