Class Utils
java.lang.Object
com.vaadin.flow.component.spreadsheet.charts.converter.Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TcallMethodUsingReflection(Object o, String name) static List<org.apache.poi.ss.util.CellReference> getAllReferencedCells(String formula, Spreadsheet spreadsheet, boolean includeHiddenCells) This function returns all the cells that the given formula references.static List<org.apache.poi.ss.util.CellReference> getAllReferencedCells(org.apache.poi.ss.SpreadsheetVersion version, String formula) Returns all cells in the referenced areas.static List<org.apache.poi.ss.util.CellReference> getAllReferencedVisibleCells(String formula, Spreadsheet spreadsheet) This function uses the getAllReferencedCells function but filters out all the hidden rows from the list honoring filtering of charts based on spreadsheettable filter settingsstatic org.apache.poi.ss.util.AreaReference[]getAreaReferences(org.apache.poi.ss.SpreadsheetVersion version, String formula) Returns an array of contiguous area references addressed by the given formula.static <E extends Enum>
EgetEnumValueOrDefault(Class<? extends E> eClass, String value, E defaultValue) static DoublegetNumericValue(org.apache.poi.ss.util.CellReference ref, Spreadsheet spreadsheet) static StringgetStringValue(org.apache.poi.ss.util.CellReference ref, Spreadsheet spreadsheet) static StringgetStringValueFromFormula(String formula, Spreadsheet spreadsheet) static String
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
callMethodUsingReflection
-
getEnumValueOrDefault
-
getStringValueFromFormula
-
join
-
getAllReferencedCells
public static List<org.apache.poi.ss.util.CellReference> getAllReferencedCells(org.apache.poi.ss.SpreadsheetVersion version, String formula) Returns all cells in the referenced areas.- Parameters:
version- for inferring ranges for column-only referencesformula-- Returns:
- all cells in the referenced areas
-
getAreaReferences
public static org.apache.poi.ss.util.AreaReference[] getAreaReferences(org.apache.poi.ss.SpreadsheetVersion version, String formula) Returns an array of contiguous area references addressed by the given formula.- Parameters:
version- to infer max # of rows for column-only formula referencesformula- containing possibly non-contiguous area refrences- Returns:
- array of references
-
getAllReferencedVisibleCells
public static List<org.apache.poi.ss.util.CellReference> getAllReferencedVisibleCells(String formula, Spreadsheet spreadsheet) This function uses the getAllReferencedCells function but filters out all the hidden rows from the list honoring filtering of charts based on spreadsheettable filter settings -
getAllReferencedCells
public static List<org.apache.poi.ss.util.CellReference> getAllReferencedCells(String formula, Spreadsheet spreadsheet, boolean includeHiddenCells) This function returns all the cells that the given formula references. You can optionally filter out all the hidden rows from the list honoring filtering of charts based on spreadsheettable filter settings.- Parameters:
formula- The formula to find referenced cells forspreadsheet- Spreadsheet to operate onincludeHiddenCells-trueto include cells residing on hidden rows or columns,falseto omit them
-
getStringValue
public static String getStringValue(org.apache.poi.ss.util.CellReference ref, Spreadsheet spreadsheet) -
getNumericValue
public static Double getNumericValue(org.apache.poi.ss.util.CellReference ref, Spreadsheet spreadsheet)
-