@Test public void shouldBeAbleToConvertNull() { assertThat(converter.convert(null, Time.class, bundle), is(nullValue())); }
public Time convert(String value, Class<? extends Time> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return null; } Locale locale = localization.getLocale(); if (locale == null) { locale = Locale.getDefault(); } DateFormat formatHour = DateFormat.getTimeInstance(DateFormat.SHORT, locale); try { if (isUncompleteTime(value)) { value = value + ":00"; } return new Time(formatHour.parse(value).getTime()); } catch (ParseException pe) { throw new ConversionError(MessageFormat.format( bundle.getString("is_not_a_valid_time"), value)); } }
LocaleBasedTimeConverter implements Converter<Time> { public Time convert(String value, Class<? extends Time> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return null; } Locale locale = localization.getLocale(); if (locale == null) { locale = Locale.getDefault(); } DateFormat formatHour = DateFormat.getTimeInstance(DateFormat.SHORT, locale); try { if (isUncompleteTime(value)) { value = value + ":00"; } return new Time(formatHour.parse(value).getTime()); } catch (ParseException pe) { throw new ConversionError(MessageFormat.format( bundle.getString("is_not_a_valid_time"), value)); } } }
LocaleBasedTimeConverter implements Converter<Time> { public Time convert(String value, Class<? extends Time> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return null; } Locale locale = localization.getLocale(); if (locale == null) { locale = Locale.getDefault(); } DateFormat formatHour = DateFormat.getTimeInstance(DateFormat.SHORT, locale); try { if (isUncompleteTime(value)) { value = value + ":00"; } return new Time(formatHour.parse(value).getTime()); } catch (ParseException pe) { throw new ConversionError(MessageFormat.format( bundle.getString("is_not_a_valid_time"), value)); } } LocaleBasedTimeConverter(Localization localization); }
LocaleBasedTimeConverter implements Converter<Time> { public Time convert(String value, Class<? extends Time> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return null; } Locale locale = localization.getLocale(); if (locale == null) { locale = Locale.getDefault(); } DateFormat formatHour = DateFormat.getTimeInstance(DateFormat.SHORT, locale); try { if (isUncompleteTime(value)) { value = value + ":00"; } return new Time(formatHour.parse(value).getTime()); } catch (ParseException pe) { throw new ConversionError(MessageFormat.format( bundle.getString("is_not_a_valid_time"), value)); } } LocaleBasedTimeConverter(Localization localization); Time convert(String value, Class<? extends Time> type,
			ResourceBundle bundle); }
LocaleBasedTimeConverter implements Converter<Time> { public Time convert(String value, Class<? extends Time> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return null; } Locale locale = localization.getLocale(); if (locale == null) { locale = Locale.getDefault(); } DateFormat formatHour = DateFormat.getTimeInstance(DateFormat.SHORT, locale); try { if (isUncompleteTime(value)) { value = value + ":00"; } return new Time(formatHour.parse(value).getTime()); } catch (ParseException pe) { throw new ConversionError(MessageFormat.format( bundle.getString("is_not_a_valid_time"), value)); } } LocaleBasedTimeConverter(Localization localization); Time convert(String value, Class<? extends Time> type,
			ResourceBundle bundle);  }