Summary: Methods | Inherited Methods | [Expand All]
public class

# ContentElement

extends Object

java.lang.Object
↳ | com.pdftron.layout.ContentElement

Known Direct Subclasses ContentNode, TextRun, TextStyledElement
ContentNode | Base class for all elements in the document content tree that can contain other content elements.
TextRun | A TextRun is a content element that represents a single run of text.
TextStyledElement | A TextStyledElement provides access to the text style properties of a `ContentElement`.

Known Indirect Subclasses List, ListItem, Paragraph, Table, TableCell, TableRow
List | A class representing a list in the document content tree.
ListItem | A class representing an item in a list in the document content tree.
Paragraph | A Paragraph is a content node that contains a list of `TextRun` objects.
Table | A Table is a content node that contains a grid of cells.
TableCell | A class representing a table cell, which can be used during document creation.
TableRow | A class representing a table row, which can be used during document creation.

## Class Overview

Base class for all content elements in the document content tree. It contains methods to retrieve instances of derived classes via the asDerivedClass() methods.

## Summary

Public Methods
ContentNode | asContentNode() Retrieve the `ContentNode` object for this content element if it is a content node.
List | asList() Retrieve the `List` object for this content element if it is a list.
ListItem | asListItem() Retrieve the `ListItem` object for this content element if it is a list item.
Paragraph | asParagraph() Retrieve the `Paragraph` object for this content element if it is a paragraph.
Table | asTable() Retrieve the `Table` object for this content element if it is a table.
TableCell | asTableCell() Retrieve the `TableCell` object for this content element if it is a table cell.
TableRow | asTableRow() Retrieve the `TableRow` object for this content element if it is a table row.
TextRun | asTextRun() Retrieve the `TextRun` object for this content element if it is a text run.
TextStyledElement | getTextStyledElement() Retrieve the `TextStyledElement` object for manipulating the text style of this content element.

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Methods

#### public ContentNode asContentNode ()

Retrieve the `ContentNode` object for this content element if it is a content node.

##### Returns

- The `ContentNode` object, or `null` if it is not a content node

##### Throws

PDFNetException |

#### public List asList ()

Retrieve the `List` object for this content element if it is a list.

##### Returns

- The `List` object, or `null` if it is not a list

##### Throws

PDFNetException |

#### public ListItem asListItem ()

Retrieve the `ListItem` object for this content element if it is a list item.

##### Returns

- The `ListItem` object, or `null` if it is not a list item

##### Throws

PDFNetException |

#### public Paragraph asParagraph ()

Retrieve the `Paragraph` object for this content element if it is a paragraph.

##### Returns

- The `Paragraph` object, or `null` if it is not a paragraph

##### Throws

PDFNetException |

#### public Table asTable ()

Retrieve the `Table` object for this content element if it is a table.

##### Returns

- The `Table` object, or `null` if it is not a table

##### Throws

PDFNetException |

#### public TableCell asTableCell ()

Retrieve the `TableCell` object for this content element if it is a table cell.

##### Returns

- The `TableCell` object, or `null` if it is not a table cell

##### Throws

PDFNetException |

#### public TableRow asTableRow ()

Retrieve the `TableRow` object for this content element if it is a table row.

##### Returns

- The `TableRow` object, or `null` if it is not a table row

##### Throws

PDFNetException |

#### public TextRun asTextRun ()

Retrieve the `TextRun` object for this content element if it is a text run.

##### Returns

- The `TextRun` object, or `null` if it is not a text run

##### Throws

PDFNetException |

#### public TextStyledElement getTextStyledElement ()

Retrieve the `TextStyledElement` object for manipulating the text style of this content element.

##### Returns

- The `TextStyledElement` object