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