com.vaadin.ui.declarative.converters.
Class DesignTimeZoneConverter
- java.lang.Object
-
- com.vaadin.ui.declarative.converters.DesignTimeZoneConverter
-
All Implemented Interfaces:
public class DesignTimeZoneConverter extends Object implements Converter<String,TimeZone>
Utility class for
DesignAttributeHandler
that deals with converting various TimeZones to string.Since:
7.4
Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.data.util.converter.Converter
Converter.ConversionException
-
-
Constructor Summary
Constructors Constructor Description DesignTimeZoneConverter()
-
Method Summary
All Methods Modifier and Type Method Description TimeZone
convertToModel(String value, Class<? extends TimeZone> targetTimeZone, Locale locale)
Converts the given value from target type to source type.
String
convertToPresentation(TimeZone value, Class<? extends String> targetTimeZone, Locale locale)
Converts the given value from source type to target type.
Class<TimeZone>
getModelType()
The source type of the converter.
Class<String>
getPresentationType()
The target type of the converter.
-
-
-
Method Detail
-
convertToModel
public TimeZone convertToModel(String value, Class<? extends TimeZone> targetTimeZone, Locale locale) throws Converter.ConversionException
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.Specified by:
convertToModel
in interfaceConverter<String,TimeZone>
Parameters:
value
- The value to convert, compatible with the target type. Can be nulltargetTimeZone
- 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
-
convertToPresentation
public String convertToPresentation(TimeZone value, Class<? extends String> targetTimeZone, Locale locale) throws Converter.ConversionException
Description copied from interface:
Converter
Converts the given value from source type to target 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.Specified by:
convertToPresentation
in interfaceConverter<String,TimeZone>
Parameters:
value
- The value to convert, compatible with the target type. Can be nulltargetTimeZone
- 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 Class<TimeZone> getModelType()
Description copied from interface:
Converter
The source type of the converter. Values of this type can be passed to
Converter.convertToPresentation(Object, Class, Locale)
.Specified by:
getModelType
in interfaceConverter<String,TimeZone>
Returns:
The source type
-
getPresentationType
public Class<String> getPresentationType()
Description copied from interface:
Converter
The target type of the converter. Values of this type can be passed to
Converter.convertToModel(Object, Class, Locale)
.Specified by:
getPresentationType
in interfaceConverter<String,TimeZone>
Returns:
The target type
-
-