org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure

## Class PDStructureElement

- java.lang.Object
- - org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureNode
  - - org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureElement

All Implemented Interfaces:
  COSObjectable

    public class PDStructureElement
    extends PDStructureNode

A structure element.

Author:
  Ben Litchfield, Johannes Koch

### Field Summary

Fields
`static String` `TYPE`

### Constructor Summary

Constructors
Constructor and Description
`PDStructureElement(COSDictionary dic)` Constructor for an existing structure element.
`PDStructureElement(String structureType, PDStructureNode parent)` Constructor with required values.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addAttribute(PDAttributeObject attributeObject)` Adds an attribute object.
`void` `addClassName(String className)` Adds a class name.
`void` `appendKid(int mcid)` Appends a marked-content sequence kid.
`void` `appendKid(PDMarkedContent markedContent)` Appends a marked-content sequence kid.
`void` `appendKid(PDMarkedContentReference markedContentReference)` Appends a marked-content reference kid.
`void` `appendKid(PDObjectReference objectReference)` Appends an object reference kid.
`void` `attributeChanged(PDAttributeObject attributeObject)` Updates the revision number for the given attribute object.
`String` `getActualText()` Returns the actual text (ActualText).
`String` `getAlternateDescription()` Returns the alternate description (Alt).
`Revisions<PDAttributeObject>` `getAttributes()` Returns the attributes together with their revision numbers (A).
`Revisions<String>` `getClassNames()` Returns the class names together with their revision numbers (C).
`String` `getElementIdentifier()` Returns the element identifier (ID).
`String` `getExpandedForm()` Returns the expanded form (E).
`String` `getLanguage()` Returns the language (Lang).
`PDPage` `getPage()` Returns the page on which some or all of the content items designated by the K entry shall be rendered (Pg).
`PDStructureNode` `getParent()` Returns the parent in the structure hierarchy (P).
`int` `getRevisionNumber()` Returns the revision number (R).
`String` `getStandardStructureType()` Returns the standard structure type, the actual structure type is mapped to in the role map.
`String` `getStructureType()` Returns the structure type (S).
`String` `getTitle()` Returns the title (T).
`void` `incrementRevisionNumber()` Increments th revision number.
`void` `insertBefore(COSInteger markedContentIdentifier, Object refKid)` Inserts a marked-content identifier kid before a reference kid.
`void` `insertBefore(PDMarkedContentReference markedContentReference, Object refKid)` Inserts a marked-content reference kid before a reference kid.
`void` `insertBefore(PDObjectReference objectReference, Object refKid)` Inserts an object reference kid before a reference kid.
`void` `removeAttribute(PDAttributeObject attributeObject)` Removes an attribute object.
`void` `removeClassName(String className)` Removes a class name.
`void` `removeKid(COSInteger markedContentIdentifier)` Removes a marked-content identifier kid.
`void` `removeKid(PDMarkedContentReference markedContentReference)` Removes a marked-content reference kid.
`void` `removeKid(PDObjectReference objectReference)` Removes an object reference kid.
`void` `setActualText(String actualText)` Sets the actual text (ActualText).
`void` `setAlternateDescription(String alternateDescription)` Sets the alternate description (Alt).
`void` `setAttributes(Revisions<PDAttributeObject> attributes)` Sets the attributes together with their revision numbers (A).
`void` `setClassNames(Revisions<String> classNames)` Sets the class names together with their revision numbers (C).
`void` `setElementIdentifier(String id)` Sets the element identifier (ID).
`void` `setExpandedForm(String expandedForm)` Sets the expanded form (E).
`void` `setLanguage(String language)` Sets the language (Lang).
`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).
`void` `setParent(PDStructureNode structureNode)` Sets the parent in the structure hierarchy (P).
`void` `setRevisionNumber(int revisionNumber)` Sets the revision number (R).
`void` `setStructureType(String structureType)` Sets the structure type (S).
`void` `setTitle(String title)` Sets the title (T).

### Methods inherited from class org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureNode

`appendKid, appendKid, appendObjectableKid, create, createObject, getCOSObject, getKids, getType, insertBefore, insertBefore, insertObjectableBefore, removeKid, removeKid, removeObjectableKid, setKids`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### TYPE

    public static final String TYPE

See Also:
  Constant Field Values

### Constructor Detail

#### PDStructureElement

    public PDStructureElement(String structureType,
                              PDStructureNode parent)

Constructor with required values.

Parameters:
  `structureType` - The structure type. Constants are available in the `StandardStructureTypes` class.
  `parent` - The parent structure node.

#### PDStructureElement

    public PDStructureElement(COSDictionary dic)

Constructor for an existing structure element.

Parameters:
  `dic` - The existing dictionary.

### Method Detail

#### getStructureType

    public String getStructureType()

Returns the structure type (S).

Returns:
  the structure type

#### setStructureType

    public final void setStructureType(String structureType)

Sets the structure type (S).

Parameters:
  `structureType` - the structure type

#### getParent

    public PDStructureNode getParent()

Returns the parent in the structure hierarchy (P).

Returns:
  the parent in the structure hierarchy

#### setParent

    public final void setParent(PDStructureNode structureNode)

Sets the parent in the structure hierarchy (P).

Parameters:
  `structureNode` - the parent in the structure hierarchy

#### getElementIdentifier

    public String getElementIdentifier()

Returns the element identifier (ID).

Returns:
  the element identifier

#### setElementIdentifier

    public void setElementIdentifier(String id)

Sets the element identifier (ID).

Parameters:
  `id` - the element identifier

#### getPage

    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:
  the page on which some or all of the content items designated by the K entry shall be rendered

#### setPage

    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` - the page on which some or all of the content items designated by the K entry shall be rendered.

#### getAttributes

    public Revisions<PDAttributeObject> getAttributes()

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

Returns:
  the attributes as a list, never null.

#### setAttributes

    public void setAttributes(Revisions<PDAttributeObject> attributes)

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

Parameters:
  `attributes` - the attributes

#### addAttribute

    public void addAttribute(PDAttributeObject attributeObject)

Adds an attribute object.

Parameters:
  `attributeObject` - the attribute object

#### removeAttribute

    public void removeAttribute(PDAttributeObject attributeObject)

Removes an attribute object.

Parameters:
  `attributeObject` - the attribute object

#### attributeChanged

    public void attributeChanged(PDAttributeObject attributeObject)

Updates the revision number for the given attribute object.

Parameters:
  `attributeObject` - the attribute object

#### getClassNames

    public Revisions<String> getClassNames()

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

Returns:
  the class names as a list, never null.

#### setClassNames

    public void setClassNames(Revisions<String> classNames)

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

Parameters:
  `classNames` - the class names

#### addClassName

    public void addClassName(String className)

Adds a class name.

Parameters:
  `className` - the class name

#### removeClassName

    public void removeClassName(String className)

Removes a class name.

Parameters:
  `className` - the class name

#### getRevisionNumber

    public int getRevisionNumber()

Returns the revision number (R).

Returns:
  the revision number

#### setRevisionNumber

    public void setRevisionNumber(int revisionNumber)

Sets the revision number (R).

Parameters:
  `revisionNumber` - the revision number

#### incrementRevisionNumber

    public void incrementRevisionNumber()

Increments th revision number.

#### getTitle

    public String getTitle()

Returns the title (T).

Returns:
  the title

#### setTitle

    public void setTitle(String title)

Sets the title (T).

Parameters:
  `title` - the title

#### getLanguage

    public String getLanguage()

Returns the language (Lang).

Returns:
  the language

#### setLanguage

    public void setLanguage(String language)

Sets the language (Lang).

Parameters:
  `language` - the language

#### getAlternateDescription

    public String getAlternateDescription()

Returns the alternate description (Alt).

Returns:
  the alternate description

#### setAlternateDescription

    public void setAlternateDescription(String alternateDescription)

Sets the alternate description (Alt).

Parameters:
  `alternateDescription` - the alternate description

#### getExpandedForm

    public String getExpandedForm()

Returns the expanded form (E).

Returns:
  the expanded form

#### setExpandedForm

    public void setExpandedForm(String expandedForm)

Sets the expanded form (E).

Parameters:
  `expandedForm` - the expanded form

#### getActualText

    public String getActualText()

Returns the actual text (ActualText).

Returns:
  the actual text

#### setActualText

    public void setActualText(String actualText)

Sets the actual text (ActualText).

Parameters:
  `actualText` - the actual text

#### getStandardStructureType

    public String getStandardStructureType()

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

Returns:
  the standard structure type

#### appendKid

    public void appendKid(int mcid)

Appends a marked-content sequence kid.

Parameters:
  `mcid` - the marked-content id (MCID).
Throws:
  `IllegalArgumentException` - if the mcid is negative.

#### appendKid

    public void appendKid(PDMarkedContent markedContent)

Appends a marked-content sequence kid.

Parameters:
  `markedContent` - the marked-content sequence with the MCID.
Throws:
  `IllegalArgumentException` - if the mcid is negative or doesn't exist.

#### appendKid

    public void appendKid(PDMarkedContentReference markedContentReference)

Appends a marked-content reference kid.

Parameters:
  `markedContentReference` - the marked-content reference

#### appendKid

    public void appendKid(PDObjectReference objectReference)

Appends an object reference kid.

Parameters:
  `objectReference` - the object reference

#### insertBefore

    public void insertBefore(COSInteger markedContentIdentifier,
                             Object refKid)

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

Parameters:
  `markedContentIdentifier` - the marked-content identifier
  `refKid` - the reference kid

#### insertBefore

    public void insertBefore(PDMarkedContentReference markedContentReference,
                             Object refKid)

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

Parameters:
  `markedContentReference` - the marked-content reference
  `refKid` - the reference kid

#### insertBefore

    public void insertBefore(PDObjectReference objectReference,
                             Object refKid)

Inserts an object reference kid before a reference kid.

Parameters:
  `objectReference` - the object reference
  `refKid` - the reference kid

#### removeKid

    public void removeKid(COSInteger markedContentIdentifier)

Removes a marked-content identifier kid.

Parameters:
  `markedContentIdentifier` - the marked-content identifier

#### removeKid

    public void removeKid(PDMarkedContentReference markedContentReference)

Removes a marked-content reference kid.

Parameters:
  `markedContentReference` - the marked-content reference

#### removeKid

    public void removeKid(PDObjectReference objectReference)

Removes an object reference kid.

Parameters:
  `objectReference` - the object reference