Record Class Slicer

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.content.Slicer
Record Components:
name - internal slicer name
caption - header caption shown above the slicer body
cacheName - name of the backing slicer cache
sourceField - the pivot field / table column the slicer filters
tableSlicer - true when it filters an Excel Table (no pivot link)
pivotTables - names of the pivot tables filtered (empty for a table slicer)
columnCount - number of item columns in the slicer UI
showCaption - whether the caption header is shown
style - slicer style name (may be empty)
sheetIndex - 0-based index of the sheet the control displays on (-1 = unknown)
row - anchor from-corner row (0-based)
col - anchor from-corner column (0-based)
endRow - anchor to-corner row (0-based)
endCol - anchor to-corner column (0-based)

public record Slicer(String name, String caption, String cacheName, String sourceField, boolean tableSlicer, List<String> pivotTables, int columnCount, boolean showCaption, String style, int sheetIndex, int row, int col, int endRow, int endCol) extends Record
A workbook slicer descriptor (immutable, read-only): an interactive filter control bound to a pivot table or an Excel Table. Read back with Workbook.slicers(); author it with Workbook.addSlicer(name, source) or the anchored overload Workbook.addSlicer(name, source, pivotTable, sheetIndex, row, col, endRow, endCol).

The structural facts here โ€” name(), caption(), the filtered sourceField(), the linked pivotTables(), columnCount() and the on-sheet anchor (sheetIndex(), row()/col() to endRow()/endCol()) โ€” round-trip through the model, and the export path synthesizes the full display apparatus (slicer part, cache part, workbook registration, worksheet <x14:slicerList> extension and drawing frame) from them. The item selection is read and changed with Workbook.slicerSelection(java.lang.String) and Workbook.setSlicerSelection(java.lang.String, java.lang.String...); a changed selection refreshes the filtered pivot tables at once. The style is changed with Workbook.setSlicerStyle(java.lang.String, java.lang.String). This record is a snapshot and carries neither the selection nor the item list.

Reference: ECMA-376 Part 4 ยง18.10 (slicers); [MS-XLSX] slicerCacheDefinition.

  • Constructor Details

    • Slicer

      public Slicer(String name, String caption, String cacheName, String sourceField, boolean tableSlicer, List<String> pivotTables, int columnCount, boolean showCaption, String style, int sheetIndex, int row, int col, int endRow, int endCol)
      Creates an instance of a Slicer record class.
      Parameters:
      name - the value for the name record component
      caption - the value for the caption record component
      cacheName - the value for the cacheName record component
      sourceField - the value for the sourceField record component
      tableSlicer - the value for the tableSlicer record component
      pivotTables - the value for the pivotTables record component
      columnCount - the value for the columnCount record component
      showCaption - the value for the showCaption record component
      style - the value for the style record component
      sheetIndex - the value for the sheetIndex record component
      row - the value for the row record component
      col - the value for the col record component
      endRow - the value for the endRow record component
      endCol - the value for the endCol record component
  • Method Details

    • fromMap

      public static Slicer fromMap(Map<String,Object> m)
      Build a Slicer from one decoded FFI JSON object.
    • 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 '=='.
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • caption

      public String caption()
      Returns the value of the caption record component.
      Returns:
      the value of the caption record component
    • cacheName

      public String cacheName()
      Returns the value of the cacheName record component.
      Returns:
      the value of the cacheName record component
    • sourceField

      public String sourceField()
      Returns the value of the sourceField record component.
      Returns:
      the value of the sourceField record component
    • tableSlicer

      public boolean tableSlicer()
      Returns the value of the tableSlicer record component.
      Returns:
      the value of the tableSlicer record component
    • pivotTables

      public List<String> pivotTables()
      Returns the value of the pivotTables record component.
      Returns:
      the value of the pivotTables record component
    • columnCount

      public int columnCount()
      Returns the value of the columnCount record component.
      Returns:
      the value of the columnCount record component
    • showCaption

      public boolean showCaption()
      Returns the value of the showCaption record component.
      Returns:
      the value of the showCaption record component
    • style

      public String style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • sheetIndex

      public int sheetIndex()
      Returns the value of the sheetIndex record component.
      Returns:
      the value of the sheetIndex record component
    • row

      public int row()
      Returns the value of the row record component.
      Returns:
      the value of the row record component
    • col

      public int col()
      Returns the value of the col record component.
      Returns:
      the value of the col record component
    • endRow

      public int endRow()
      Returns the value of the endRow record component.
      Returns:
      the value of the endRow record component
    • endCol

      public int endCol()
      Returns the value of the endCol record component.
      Returns:
      the value of the endCol record component