Record Class Table

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.Table
Record Components:
id - 選填識別
columns - 欄定義
headerRows - 指定表頭列;啟用 columnTitles 時追加在欄標題之後
rows - 列來源
style - 表格樣式覆寫;null 表示沿用文件預設
repeatHeader - 是否每頁重複表頭
columnTitles - 是否先產生欄標題列;預設 true,false 僅使用指定的 headerRows
maxRecordsPerPage - 每頁此表格的邏輯紀錄上限;0 表示不限制,正值時每筆完整放置
firstHeaderRows - 首張表格頁的指定表頭;空清單沿用headerRows,續頁仍使用headerRows
All Implemented Interfaces:
Block

public record Table(String id, List<Column> columns, List<TableRow> headerRows, RowSource rows, TableStyle style, boolean repeatHeader, boolean columnTitles, int maxRecordsPerPage, List<TableRow> firstHeaderRows) extends Record implements Block

可跨頁表格

預設以各欄的 Column.title() 產生標題列,再追加 headerRows;關閉 columnTitles 時只使用指定表頭。 repeatHeader 時每頁重複完整表頭。 群組跨頁時 renderer 依列的 groupPath 補續接列,格式見 TableStyle.continuationLabel()。

Since:
4.0.0
  • Constructor Details

    • Table

      public Table(String id, List<Column> columns, List<TableRow> headerRows, RowSource rows, TableStyle style, boolean repeatHeader, boolean columnTitles, int maxRecordsPerPage)
      保留八參數建構器;首張表格頁沿用共同表頭。
    • Table

      public Table(String id, List<Column> columns, List<TableRow> headerRows, RowSource rows, TableStyle style, boolean repeatHeader)
      相容既有六參數建構器;保留自動欄標題
    • Table

      public Table(String id, List<Column> columns, List<TableRow> headerRows, RowSource rows, TableStyle style, boolean repeatHeader, boolean columnTitles, int maxRecordsPerPage, List<TableRow> firstHeaderRows)
      Creates an instance of a Table record class.
      Parameters:
      id - the value for the id record component
      columns - the value for the columns record component
      headerRows - the value for the headerRows record component
      rows - the value for the rows record component
      style - the value for the style record component
      repeatHeader - the value for the repeatHeader record component
      columnTitles - the value for the columnTitles record component
      maxRecordsPerPage - the value for the maxRecordsPerPage record component
      firstHeaderRows - the value for the firstHeaderRows record component
  • Method Details

    • 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • columns

      public List<Column> columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • headerRows

      public List<TableRow> headerRows()
      Returns the value of the headerRows record component.
      Returns:
      the value of the headerRows record component
    • rows

      public RowSource rows()
      Returns the value of the rows record component.
      Returns:
      the value of the rows record component
    • style

      public TableStyle style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • repeatHeader

      public boolean repeatHeader()
      Returns the value of the repeatHeader record component.
      Returns:
      the value of the repeatHeader record component
    • columnTitles

      public boolean columnTitles()
      Returns the value of the columnTitles record component.
      Returns:
      the value of the columnTitles record component
    • maxRecordsPerPage

      public int maxRecordsPerPage()
      Returns the value of the maxRecordsPerPage record component.
      Returns:
      the value of the maxRecordsPerPage record component
    • firstHeaderRows

      public List<TableRow> firstHeaderRows()
      Returns the value of the firstHeaderRows record component.
      Returns:
      the value of the firstHeaderRows record component