TextElement

data class TextElement(val locator: Locator, val role: Content.TextElement.Role, val segments: List<Content.TextElement.Segment>, val attributes: List<Content.Attribute<*>> = emptyList()) : Content.TextualElement

A text element.

Parameters

role

Purpose of this element in the broader context of the document.

segments

Ranged portions of text with associated attributes.

Constructors

Link copied to clipboard
constructor(locator: Locator, role: Content.TextElement.Role, segments: List<Content.TextElement.Segment>, attributes: List<Content.Attribute<*>> = emptyList())

Types

Link copied to clipboard
interface Role

Represents a purpose of an element in the broader context of the document.

Link copied to clipboard
data class Segment(val locator: Locator, val text: String, val attributes: List<Content.Attribute<*>>) : Content.AttributesHolder

Ranged portion of text with associated attributes.

Properties

Link copied to clipboard
Link copied to clipboard
open override val attributes: List<Content.Attribute<*>>

Associated list of attributes.

Link copied to clipboard
open val language: Language?
Link copied to clipboard
open override val locator: Locator

Locator targeting this element in the Publication.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val text: String

Human-readable text representation for this element.

Functions

Link copied to clipboard
open fun <V> attribute(key: Content.AttributeKey<V>): V?

Gets the first attribute with the given key.

Link copied to clipboard
open fun <V> attributes(key: Content.AttributeKey<V>): List<V>

Gets all the attributes with the given key.