public class DesignTimeZoneConverter extends Object implements Converter<String,TimeZone>
DesignAttributeHandler that deals with converting
various TimeZones to string.Converter.ConversionException| Constructor and Description |
|---|
DesignTimeZoneConverter() |
| Modifier and Type | Method and 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.
|
public TimeZone convertToModel(String value, Class<? extends TimeZone> targetTimeZone, 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.convertToModel in interface Converter<String,TimeZone>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.Converter.ConversionException - If the value could not be convertedpublic String convertToPresentation(TimeZone value, Class<? extends String> targetTimeZone, 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.convertToPresentation in interface Converter<String,TimeZone>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.Converter.ConversionException - If the value could not be convertedpublic Class<TimeZone> getModelType()
ConverterConverter.convertToPresentation(Object, Class, Locale).getModelType in interface Converter<String,TimeZone>public Class<String> getPresentationType()
ConverterConverter.convertToModel(Object, Class, Locale).getPresentationType in interface Converter<String,TimeZone>Copyright © 2017 Vaadin Ltd. All rights reserved.