Binder.forField(...).withConverter(...) methods.@Deprecated public class StringToByteConverter extends AbstractStringToNumberConverter<Byte>
String to Byte and back. Uses
the given locale and a NumberFormat instance for formatting and
parsing.
Override and overwrite getFormat(Locale) to use a different format.
Converter.ConversionException| Constructor and Description |
|---|
StringToByteConverter()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
Byte |
convertToModel(String value,
Class<? extends Byte> targetType,
Locale locale)
Deprecated.
Converts the given value from target type to source type.
|
protected NumberFormat |
getFormat(Locale locale)
Deprecated.
Returns the format used by
#convertToPresentation(Byte, Class, Locale) and
convertToModel(String, Class, Locale). |
Class<Byte> |
getModelType()
Deprecated.
The source type of the converter.
|
convertToNumber, convertToPresentation, getPresentationTypeprotected NumberFormat getFormat(Locale locale)
#convertToPresentation(Byte, Class, Locale) and
convertToModel(String, Class, Locale).getFormat in class AbstractStringToNumberConverter<Byte>locale - The locale to usepublic Byte convertToModel(String value, Class<? extends Byte> targetType, Locale locale) throws Converter.ConversionException
ConverterA 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<Byte> getModelType()
ConverterConverter.convertToPresentation(Object, Class, Locale).Copyright © 2019 Vaadin Ltd. All rights reserved.