Record Class TextRun
java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.model.text.TextRun
- Record Components:
text- literal text, including any spaces or line feedsstyle- optional run-level overrides, or null to inherit from the block or cellhref- external hyperlink target, or null for unlinked textpageNumber- optional dynamic page field; text must be empty when supplied
Literal inline text with optional style overrides and an external hyperlink. Text is XML-escaped
during rendering, and spaces and line feeds are preserved by text blocks; it is never interpreted
as HTML markup. Styles apply after the containing block or cell.
Construction performs no validation. Generation permits empty text but requires nonnull XML-compatible text. A supplied link must be a syntactically valid absolute HTTP, HTTPS, or mailto URI with a nonempty scheme-specific part; HTTP(S) links also require a host.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TextRunfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.href()Returns the value of thehrefrecord component.static TextRunReturns the value of thepageNumberrecord component.style()Returns the value of thestylerecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TextRun
Creates a literal text run without a dynamic page field.- Parameters:
text- literal textstyle- nullable inline stylehref- nullable link destination
-
TextRun
Creates an instance of aTextRunrecord class.- Parameters:
text- the value for thetextrecord componentstyle- the value for thestylerecord componenthref- the value for thehrefrecord componentpageNumber- the value for thepageNumberrecord component
-
-
Method Details
-
currentPage
- Returns:
- a current physical page-number run with inherited appearance
-
pageCount
- Returns:
- a total physical page-count run with inherited appearance
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
style
Returns the value of thestylerecord component.- Returns:
- the value of the
stylerecord component
-
href
Returns the value of thehrefrecord component.- Returns:
- the value of the
hrefrecord component
-
pageNumber
Returns the value of thepageNumberrecord component.- Returns:
- the value of the
pageNumberrecord component
-