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/b、em/i、u、s/del/strike、sup、sub、span[style*=color]。
為何共用
由 document(→ Word run)與 workbook(→ Excel rich text run)共用。
marks 詞彙是兩者唯一同源的部分——RichTextEditor 長出新 mark 時,兩邊必須同時認得它,
否則同一份內容匯出到 Word 保留、匯出到 Excel 靜默丟失。走訪與輸出各自實作(Word 有區塊/圖片,
Excel 儲存格兩者皆無),不強求共用。
非公開 API
依 30-public-api.md 的 internal 套件豁免——類別雖為 public(跨套件共用所需),
但不屬對外契約、不受 SemVer 凍結。
-
Constructor Summary
ConstructorsConstructorDescriptionInlineFormat(boolean bold, boolean italic, boolean underline, boolean strike, boolean superscript, boolean subscript, Color color) Creates an instance of aInlineFormatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbold()Returns the value of theboldrecord component.color()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.extend(org.jsoup.nodes.Element element) 依 HTML 元素擴充格式final inthashCode()Returns a hash code value for this object.booleanisNone()是否未帶任何格式booleanitalic()Returns the value of theitalicrecord component.static InlineFormatnone()無任何格式的初始狀態booleanstrike()Returns the value of thestrikerecord component.booleanReturns the value of thesubscriptrecord component.booleanReturns the value of thesuperscriptrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theunderlinerecord component.
-
Constructor Details
-
InlineFormat
public InlineFormat(boolean bold, boolean italic, boolean underline, boolean strike, boolean superscript, boolean subscript, Color color) Creates an instance of aInlineFormatrecord class.- Parameters:
bold- the value for theboldrecord componentitalic- the value for theitalicrecord componentunderline- the value for theunderlinerecord componentstrike- the value for thestrikerecord componentsuperscript- the value for thesuperscriptrecord componentsubscript- the value for thesubscriptrecord componentcolor- the value for thecolorrecord component
-
-
Method Details
-
none
-
isNone
public boolean isNone()是否未帶任何格式- Returns:
- 無格式時為
true
-
extend
依 HTML 元素擴充格式
巢狀 marks 逐層繼承——已開啟的格式不會被內層關閉,顏色則由內層覆寫。
- Parameters:
element- HTML 元素- Returns:
- 擴充後的格式(原狀態不變)
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
bold
public boolean bold()Returns the value of theboldrecord component.- Returns:
- the value of the
boldrecord component
-
italic
public boolean italic()Returns the value of theitalicrecord component.- Returns:
- the value of the
italicrecord component
-
underline
public boolean underline()Returns the value of theunderlinerecord component.- Returns:
- the value of the
underlinerecord component
-
strike
public boolean strike()Returns the value of thestrikerecord component.- Returns:
- the value of the
strikerecord component
-
superscript
public boolean superscript()Returns the value of thesuperscriptrecord component.- Returns:
- the value of the
superscriptrecord component
-
subscript
public boolean subscript()Returns the value of thesubscriptrecord component.- Returns:
- the value of the
subscriptrecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-