Class StringToDoubleConverter
- java.lang.Object
-
- com.vaadin.v7.data.util.converter.AbstractStringToNumberConverter<java.lang.Double>
-
- com.vaadin.v7.data.util.converter.StringToDoubleConverter
-
- All Implemented Interfaces:
Converter<java.lang.String,java.lang.Double>
,java.io.Serializable
@Deprecated public class StringToDoubleConverter extends AbstractStringToNumberConverter<java.lang.Double>
Deprecated.A converter that converts fromString
toDouble
and back. Uses the given locale and aNumberFormat
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.- Since:
- 7.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.util.converter.Converter
Converter.ConversionException
-
-
Constructor Summary
Constructors Constructor Description StringToDoubleConverter()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Double
convertToModel(java.lang.String value, java.lang.Class<? extends java.lang.Double> targetType, java.util.Locale locale)
Deprecated.Converts the given value from target type to source type.java.lang.Class<java.lang.Double>
getModelType()
Deprecated.The source type of the converter.-
Methods inherited from class com.vaadin.v7.data.util.converter.AbstractStringToNumberConverter
convertToNumber, convertToPresentation, getFormat, getPresentationType
-
-
-
-
Method Detail
-
convertToModel
public java.lang.Double convertToModel(java.lang.String value, java.lang.Class<? extends java.lang.Double> targetType, java.util.Locale locale) throws Converter.ConversionException
Deprecated.Description copied from interface:Converter
Converts the given value from target type to source type.A converter can optionally use locale to do the conversion.
A converter should in most cases be symmetric so chainingConverter.convertToPresentation(Object, Class, Locale)
andConverter.convertToModel(Object, Class, Locale)
should return the original value.- Parameters:
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.- Returns:
- The converted value compatible with the source type
- Throws:
Converter.ConversionException
- If the value could not be converted
-
getModelType
public java.lang.Class<java.lang.Double> getModelType()
Deprecated.Description copied from interface:Converter
The source type of the converter. Values of this type can be passed toConverter.convertToPresentation(Object, Class, Locale)
.- Returns:
- The source type
-
-