/** * Convert the given value from the data source type to the UI type. * * @param newValue * The data source value to convert. * @return The converted value that is compatible with the UI type or the * original value if its type is compatible and no converter is set. * @throws Converter.ConversionException * if there is no converter and the type is not compatible with * the data source type. */ private T convertFromModel(Object newValue, Locale locale) { return ConverterUtil.convertFromModel(newValue, getType(), getConverter(), locale); }
/** * Retrieves a converter for the field from the converter factory defined * for the application. Clears the converter if no application reference is * available or if the factory returns null. * * @param datamodelType * The type of the data model that we want to be able to convert * from */ public void setConverter(Class<?> datamodelType) { Converter<T, ?> c = (Converter<T, ?>) ConverterUtil .getConverter(getType(), datamodelType, getSession()); setConverter(c); }
getType(), newDataSource.getType())) {