@Deprecated public class StringToFloatConverter extends AbstractStringToNumberConverter<Float>
String
to Float
and back. Uses
the given locale and a NumberFormat
instance for formatting and
parsing.
Leading and trailing white spaces are ignored when converting from a String.
Override and overwrite AbstractStringToNumberConverter.getFormat(Locale)
to use a different format.
Converter.ConversionException
Constructor and Description |
---|
StringToFloatConverter()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Float |
convertToModel(String value,
Class<? extends Float> targetType,
Locale locale)
Deprecated.
Converts the given value from target type to source type.
|
Class<Float> |
getModelType()
Deprecated.
The source type of the converter.
|
convertToNumber, convertToPresentation, getFormat, getPresentationType
public Float convertToModel(String value, Class<? extends Float> targetType, Locale locale) throws Converter.ConversionException
Converter
A converter can optionally use locale to do the conversion.
A converter should in most cases be symmetric so chainingConverter.convertToPresentation(Object, Class, Locale)
and
Converter.convertToModel(Object, Class, Locale)
should return the original
value.value
- The value to convert, compatible with the target type. Can be
nulltargetType
- The requested type of the return valuelocale
- The locale to use for conversion. Can be null.Converter.ConversionException
- If the value could not be convertedpublic Class<Float> getModelType()
Converter
Converter.convertToPresentation(Object, Class, Locale)
.Copyright © 2020 Vaadin Ltd. All rights reserved.