1 16 17 package org.apache.commons.beanutils.locale.converters; 18 19 import java.sql.Time ; 20 import java.text.ParseException ; 21 import java.util.Locale ; 22 23 33 34 public class SqlTimeLocaleConverter extends DateLocaleConverter { 35 36 37 39 47 public SqlTimeLocaleConverter() { 48 49 this(false); 50 } 51 52 60 public SqlTimeLocaleConverter(boolean locPattern) { 61 62 this(Locale.getDefault(), locPattern); 63 } 64 65 72 public SqlTimeLocaleConverter(Locale locale) { 73 74 this(locale, false); 75 } 76 77 85 public SqlTimeLocaleConverter(Locale locale, boolean locPattern) { 86 87 this(locale, (String ) null, locPattern); 88 } 89 90 98 public SqlTimeLocaleConverter(Locale locale, String pattern) { 99 100 this(locale, pattern, false); 101 } 102 103 112 public SqlTimeLocaleConverter(Locale locale, String pattern, boolean locPattern) { 113 114 super(locale, pattern, locPattern); 115 } 116 117 126 public SqlTimeLocaleConverter(Object defaultValue) { 127 128 this(defaultValue, false); 129 } 130 131 140 public SqlTimeLocaleConverter(Object defaultValue, boolean locPattern) { 141 142 this(defaultValue, Locale.getDefault(), false); 143 } 144 145 153 public SqlTimeLocaleConverter(Object defaultValue, Locale locale) { 154 155 this(defaultValue, locale, false); 156 } 157 158 167 public SqlTimeLocaleConverter(Object defaultValue, Locale locale, boolean locPattern) { 168 169 this(defaultValue, locale, null, locPattern); 170 } 171 172 181 public SqlTimeLocaleConverter(Object defaultValue, Locale locale, String pattern) { 182 183 this(defaultValue, locale, pattern, false); 184 } 185 186 196 public SqlTimeLocaleConverter(Object defaultValue, Locale locale, String pattern, boolean locPattern) { 197 198 super(defaultValue, locale, pattern, locPattern); 199 } 200 201 203 213 protected Object parse(Object value, String pattern) throws ParseException { 214 215 return new Time (((java.util.Date ) super.parse((String ) value, pattern)).getTime()); 216 } 217 } 218 | Popular Tags |