Record Class InlineFormat

java.lang.Object
java.lang.Record
io.leandev.appfuse.internal.html.InlineFormat

public record InlineFormat(boolean bold, boolean italic, boolean underline, boolean strike, boolean superscript, boolean subscript, Color color) extends Record

HTML 子集的行內格式狀態

對映 appfuse-web RichTextEditor(Tiptap/ProseMirror)輸出的行內 marks: strong/bem/ius/del/strikesupsubspan[style*=color]

為何共用document(→ Word run)與 workbook(→ Excel rich text run)共用。 marks 詞彙是兩者唯一同源的部分——RichTextEditor 長出新 mark 時,兩邊必須同時認得它, 否則同一份內容匯出到 Word 保留、匯出到 Excel 靜默丟失。走訪與輸出各自實作(Word 有區塊/圖片, Excel 儲存格兩者皆無),不強求共用。

非公開 API30-public-api.mdinternal 套件豁免——類別雖為 public(跨套件共用所需), 但不屬對外契約、不受 SemVer 凍結。

  • Constructor Summary

    Constructors
    Constructor
    Description
    InlineFormat(boolean bold, boolean italic, boolean underline, boolean strike, boolean superscript, boolean subscript, Color color)
    Creates an instance of a InlineFormat record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the bold record component.
    Returns the value of the color record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    extend(org.jsoup.nodes.Element element)
    依 HTML 元素擴充格式
    final int
    Returns a hash code value for this object.
    boolean
    是否未帶任何格式
    boolean
    Returns the value of the italic record component.
    無任何格式的初始狀態
    boolean
    Returns the value of the strike record component.
    boolean
    Returns the value of the subscript record component.
    boolean
    Returns the value of the superscript record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the underline record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • InlineFormat

      public InlineFormat(boolean bold, boolean italic, boolean underline, boolean strike, boolean superscript, boolean subscript, Color color)
      Creates an instance of a InlineFormat record class.
      Parameters:
      bold - the value for the bold record component
      italic - the value for the italic record component
      underline - the value for the underline record component
      strike - the value for the strike record component
      superscript - the value for the superscript record component
      subscript - the value for the subscript record component
      color - the value for the color record component
  • Method Details

    • none

      public static InlineFormat none()
      無任何格式的初始狀態
      Returns:
      空白格式
    • isNone

      public boolean isNone()
      是否未帶任何格式
      Returns:
      無格式時為 true
    • extend

      public InlineFormat extend(org.jsoup.nodes.Element element)

      依 HTML 元素擴充格式

      巢狀 marks 逐層繼承——已開啟的格式不會被內層關閉,顏色則由內層覆寫。

      Parameters:
      element - HTML 元素
      Returns:
      擴充後的格式(原狀態不變)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • bold

      public boolean bold()
      Returns the value of the bold record component.
      Returns:
      the value of the bold record component
    • italic

      public boolean italic()
      Returns the value of the italic record component.
      Returns:
      the value of the italic record component
    • underline

      public boolean underline()
      Returns the value of the underline record component.
      Returns:
      the value of the underline record component
    • strike

      public boolean strike()
      Returns the value of the strike record component.
      Returns:
      the value of the strike record component
    • superscript

      public boolean superscript()
      Returns the value of the superscript record component.
      Returns:
      the value of the superscript record component
    • subscript

      public boolean subscript()
      Returns the value of the subscript record component.
      Returns:
      the value of the subscript record component
    • color

      public Color color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component