TemplateDataCellValueFactory extends AbstractCellValueFactory<TemplateDataColumn, String> { public String convertToModelCell(TemplateDataColumn column, CellValue<?> cv) { DataType.DataTypes dataType = getDataType(column); if (OperatorsOracle.operatorRequiresList(column.getOperator())) { return (cv.getValue() == null ? null : cv.getValue().toString()); } switch (dataType) { case BOOLEAN: return convertBooleanValueToString(cv); case DATE: return convertDateValueToString(cv); case NUMERIC: return convertNumericValueToString(cv); case NUMERIC_BIGDECIMAL: return convertBigDecimalValueToString(cv); case NUMERIC_BIGINTEGER: return convertBigIntegerValueToString(cv); case NUMERIC_BYTE: return convertByteValueToString(cv); case NUMERIC_DOUBLE: return convertDoubleValueToString(cv); case NUMERIC_FLOAT: return convertFloatValueToString(cv); case NUMERIC_INTEGER: return convertIntegerValueToString(cv); case NUMERIC_LONG: return convertLongValueToString(cv); case NUMERIC_SHORT: return convertShortValueToString(cv); default: return convertStringValueToString(cv); } } TemplateDataCellValueFactory(final TemplateModel model,
                                        final AsyncPackageDataModelOracle oracle); static void injectDateConvertor(DateConverter dc); List<String> makeRowData(); @Override DynamicDataRow makeUIRowData(); List<String> makeColumnData(TemplateDataColumn column); List<CellValue<? extends Comparable<?>>> convertColumnData(TemplateDataColumn column,
                                                                      List<String> columnData); @Override String makeModelCellValue(TemplateDataColumn column); @Override CellValue<? extends Comparable<?>> convertModelCellValue(TemplateDataColumn column,
                                                                    String dcv); TemplateDataColumn makeModelColumn(InterpolationVariable var); String convertToModelCell(TemplateDataColumn column,
                                     CellValue<?> cv);  }
@Test public void testConvertToModelCell() { final String actualResult = templateDataCellValueFactory.convertToModelCell(new TemplateDataColumn("var", datatype, "Person", "age", operator), new CellValue(cellValue)); assertEquals(result, actualResult); }