public abstract class TypeBasedCellValueCoercer<VAL> extends Object implements CellValueCoercer<VAL>
CellValueCoercer which tests the cell's type then invokes a specific method. Default
implementation of each method throw a CannotCoerceException and are meant to be overriden in subclasses.| Modifier | Constructor and Description |
|---|---|
protected |
TypeBasedCellValueCoercer() |
protected |
TypeBasedCellValueCoercer(String errorI18nKey) |
| Modifier and Type | Method and Description |
|---|---|
VAL |
coerce(org.apache.poi.ss.usermodel.Cell cell)
Checks the cell type and callthe appropriate
coerceXxxCell(cell) accordingly |
protected VAL |
coerceBlankCell(org.apache.poi.ss.usermodel.Cell cell) |
protected VAL |
coerceBooleanCell(org.apache.poi.ss.usermodel.Cell cell) |
protected VAL |
coerceFormulaCell(org.apache.poi.ss.usermodel.Cell cell) |
protected VAL |
coerceNumericCell(org.apache.poi.ss.usermodel.Cell cell) |
protected VAL |
coerceStringCell(org.apache.poi.ss.usermodel.Cell cell) |
protected int |
liberallyParseInt(String s)
Parses a string into an int.
|
protected int |
round(double val)
Utility method which rounds a floating point number to the nearest integer.
|
protected TypeBasedCellValueCoercer()
protected TypeBasedCellValueCoercer(@NotNull
String errorI18nKey)
public final VAL coerce(org.apache.poi.ss.usermodel.Cell cell) throws CannotCoerceException
coerceXxxCell(cell) accordinglycoerce in interface CellValueCoercer<VAL>cell - the cell to coerceCannotCoerceException - when not possible to coerce.CellValueCoercer.coerce(org.apache.poi.ss.usermodel.Cell)protected VAL coerceFormulaCell(org.apache.poi.ss.usermodel.Cell cell)
cell - protected VAL coerceBooleanCell(org.apache.poi.ss.usermodel.Cell cell)
cell - protected VAL coerceBlankCell(org.apache.poi.ss.usermodel.Cell cell)
cell - protected VAL coerceStringCell(org.apache.poi.ss.usermodel.Cell cell)
cell - protected VAL coerceNumericCell(org.apache.poi.ss.usermodel.Cell cell)
cell - protected int liberallyParseInt(String s) throws CannotCoerceException
s - CannotCoerceExceptionprotected int round(double val)
val - Copyright © 2010-2016 Henix, henix.fr. All Rights Reserved.