java.lang.Object
io.github.mbenincasa.javaexcelutils.model.excel.ExcelCell

public class ExcelCell extends Object
ExcelCell is the Cell wrapper class of the Apache POI library
Since:
0.3.0
Author:
Mirko Benincasa
  • Constructor Details

    • ExcelCell

      public ExcelCell()
  • Method Details

    • of

      public static ExcelCell of(org.apache.poi.ss.usermodel.Cell cell)
      Get to an ExcelCell instance from Apache POI Cell
      Parameters:
      cell - The Cell instance to wrap
      Returns:
      The ExcelCell instance
      Since:
      0.5.0
    • remove

      public void remove() throws CellNotFoundException
      Remove the selected Cell
      Throws:
      CellNotFoundException - If the cell is not present or has not been created
      Since:
      0.4.1
    • getRow

      public ExcelRow getRow()
      Returns the Row to which it belongs
      Returns:
      A ExcelRow
    • readValue

      public Object readValue() throws ReadValueException
      Read the value written inside the Cell
      Returns:
      The value written in the Cell
      Throws:
      ReadValueException - If an error occurs while reading
      Since:
      0.4.0
    • readValue

      public Object readValue(Class<?> type) throws ReadValueException
      Read the value written inside the Cell
      Parameters:
      type - The class type of the object written to the Cell
      Returns:
      The value written in the Cell
      Throws:
      ReadValueException - If an error occurs while reading
    • readValueAsString

      public String readValueAsString()
      Read the value written inside the Cell as String
      Returns:
      The value written in the Cell
      Since:
      0.4.0
    • writeValue

      public void writeValue(Object val)
      Writes inside the cell
      Parameters:
      val - The value to write in the Cell
    • getCellName

      public String getCellName()
      Returns the cell name
      Returns:
      cell name
      Since:
      0.4.2
    • formatStyle

      public void formatStyle(short dataFormat)
      Format text according to the pattern provided
      Parameters:
      dataFormat - The Apache POI library CellStyle dataFormat
    • formatStyle

      public void formatStyle(String dataFormat)
      Format the cell according to the chosen format
      Parameters:
      dataFormat - The string that defines the data format
      Since:
      0.5.0