/** * Register the converters for other types. * </p> * This method registers the following converters: * <ul> * <li><code>Class.class</code> - {@link ClassConverter}</li> * <li><code>java.util.Date.class</code> - {@link DateConverter}</li> * <li><code>java.util.Calendar.class</code> - {@link CalendarConverter}</li> * <li><code>File.class</code> - {@link FileConverter}</li> * <li><code>java.sql.Date.class</code> - {@link SqlDateConverter}</li> * <li><code>java.sql.Time.class</code> - {@link SqlTimeConverter}</li> * <li><code>java.sql.Timestamp.class</code> - {@link SqlTimestampConverter}</li> * <li><code>URL.class</code> - {@link URLConverter}</li> * </ul> * @param throwException <code>true</code> if the converters should * throw an exception when a conversion error occurs, otherwise <code> * <code>false</code> if a default value should be used. */ private void registerOther(final boolean throwException) { register(Class.class, throwException ? new ClassConverter() : new ClassConverter(null)); register(java.util.Date.class, throwException ? new DateConverter() : new DateConverter(null)); register(Calendar.class, throwException ? new CalendarConverter() : new CalendarConverter(null)); register(File.class, throwException ? new FileConverter() : new FileConverter(null)); register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null)); register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null)); register(Timestamp.class, throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null)); register(URL.class, throwException ? new URLConverter() : new URLConverter(null)); }
/** * Sets the transactionCycleEndDate attribute. * * @param transactionCycleEndDate The transactionCycleEndDate to set. */ public void setTransactionCycleEndDate(String transactionCycleEndDate) { if (StringUtils.isNotBlank(transactionCycleEndDate)) { this.transactionCycleEndDate = (Date) (new SqlDateConverter()).convert(Date.class, transactionCycleEndDate); } }
public static void setDateTimePattern(String[] patterns) { calendarConverter.setPatterns(patterns); dateConverter.setPatterns(patterns); sqlDateConverter.setPatterns(patterns); sqlTimeConverter.setPatterns(patterns); } }
/** * Sets the transactionCycleStartDate attribute. * * @param transactionCycleStartDate The transactionCycleStartDate to set. */ public void setTransactionCycleStartDate(String transactionCycleStartDate) { if (StringUtils.isNotBlank(transactionCycleStartDate)) { this.transactionCycleStartDate = (Date) (new SqlDateConverter()).convert(Date.class, transactionCycleStartDate); } }
/** * Register the converters for other types. * </p> * This method registers the following converters: * <ul> * <li><code>Class.class</code> - {@link ClassConverter}</li> * <li><code>java.util.Date.class</code> - {@link DateConverter}</li> * <li><code>java.util.Calendar.class</code> - {@link CalendarConverter}</li> * <li><code>File.class</code> - {@link FileConverter}</li> * <li><code>java.sql.Date.class</code> - {@link SqlDateConverter}</li> * <li><code>java.sql.Time.class</code> - {@link SqlTimeConverter}</li> * <li><code>java.sql.Timestamp.class</code> - {@link SqlTimestampConverter}</li> * <li><code>URL.class</code> - {@link URLConverter}</li> * </ul> * @param throwException <code>true</code> if the converters should * throw an exception when a conversion error occurs, otherwise <code> * <code>false</code> if a default value should be used. */ private void registerOther(final boolean throwException) { register(Class.class, throwException ? new ClassConverter() : new ClassConverter(null)); register(java.util.Date.class, throwException ? new DateConverter() : new DateConverter(null)); register(Calendar.class, throwException ? new CalendarConverter() : new CalendarConverter(null)); register(File.class, throwException ? new FileConverter() : new FileConverter(null)); register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null)); register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null)); register(Timestamp.class, throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null)); register(URL.class, throwException ? new URLConverter() : new URLConverter(null)); }
SqlDateConverter converter = new SqlDateConverter(); Object obj = null; try { obj = converter.convert(java.sql.Date.class, dateValue);
registerArrayConverter(Calendar.class, new DateConverter(), throwException, defaultArraySize); registerArrayConverter(File.class, new FileConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Date.class, new SqlDateConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Time.class, new SqlTimeConverter(), throwException, defaultArraySize); registerArrayConverter(Timestamp.class, new SqlTimestampConverter(), throwException, defaultArraySize);
registerArrayConverter(Calendar.class, new DateConverter(), throwException, defaultArraySize); registerArrayConverter(File.class, new FileConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Date.class, new SqlDateConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Time.class, new SqlTimeConverter(), throwException, defaultArraySize); registerArrayConverter(Timestamp.class, new SqlTimestampConverter(), throwException, defaultArraySize);
/** * Register the converters for other types. * </p> * This method registers the following converters: * <ul> * <li><code>Class.class</code> - {@link ClassConverter}</li> * <li><code>java.util.Date.class</code> - {@link DateConverter}</li> * <li><code>java.util.Calendar.class</code> - {@link CalendarConverter}</li> * <li><code>File.class</code> - {@link FileConverter}</li> * <li><code>java.sql.Date.class</code> - {@link SqlDateConverter}</li> * <li><code>java.sql.Time.class</code> - {@link SqlTimeConverter}</li> * <li><code>java.sql.Timestamp.class</code> - {@link SqlTimestampConverter}</li> * <li><code>URL.class</code> - {@link URLConverter}</li> * </ul> * @param throwException <code>true</code> if the converters should * throw an exception when a conversion error occurs, otherwise <code> * <code>false</code> if a default value should be used. */ private void registerOther(final boolean throwException) { register(Class.class, throwException ? new ClassConverter() : new ClassConverter(null)); register(java.util.Date.class, throwException ? new DateConverter() : new DateConverter(null)); register(Calendar.class, throwException ? new CalendarConverter() : new CalendarConverter(null)); register(File.class, throwException ? new FileConverter() : new FileConverter(null)); register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null)); register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null)); register(Timestamp.class, throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null)); register(URL.class, throwException ? new URLConverter() : new URLConverter(null)); }
/** * Register the converters for other types. * </p> * This method registers the following converters: * <ul> * <li><code>Class.class</code> - {@link ClassConverter}</li> * <li><code>java.util.Date.class</code> - {@link DateConverter}</li> * <li><code>java.util.Calendar.class</code> - {@link CalendarConverter}</li> * <li><code>File.class</code> - {@link FileConverter}</li> * <li><code>java.sql.Date.class</code> - {@link SqlDateConverter}</li> * <li><code>java.sql.Time.class</code> - {@link SqlTimeConverter}</li> * <li><code>java.sql.Timestamp.class</code> - {@link SqlTimestampConverter}</li> * <li><code>URL.class</code> - {@link URLConverter}</li> * </ul> * @param throwException <code>true</code> if the converters should * throw an exception when a conversion error occurs, otherwise <code> * <code>false</code> if a default value should be used. */ private void registerOther(boolean throwException) { register(Class.class, throwException ? new ClassConverter() : new ClassConverter(null)); register(java.util.Date.class, throwException ? new DateConverter() : new DateConverter(null)); register(Calendar.class, throwException ? new CalendarConverter() : new CalendarConverter(null)); register(File.class, throwException ? new FileConverter() : new FileConverter(null)); register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null)); register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null)); register(Timestamp.class, throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null)); register(URL.class, throwException ? new URLConverter() : new URLConverter(null)); }
/** * Register the converters for other types. * </p> * This method registers the following converters: * <ul> * <li><code>Class.class</code> - {@link ClassConverter}</li> * <li><code>java.util.Date.class</code> - {@link DateConverter}</li> * <li><code>java.util.Calendar.class</code> - {@link CalendarConverter}</li> * <li><code>File.class</code> - {@link FileConverter}</li> * <li><code>java.sql.Date.class</code> - {@link SqlDateConverter}</li> * <li><code>java.sql.Time.class</code> - {@link SqlTimeConverter}</li> * <li><code>java.sql.Timestamp.class</code> - {@link SqlTimestampConverter}</li> * <li><code>URL.class</code> - {@link URLConverter}</li> * </ul> * @param throwException <code>true</code> if the converters should * throw an exception when a conversion error occurs, otherwise <code> * <code>false</code> if a default value should be used. */ private void registerOther(boolean throwException) { register(Class.class, throwException ? new ClassConverter() : new ClassConverter(null)); register(java.util.Date.class, throwException ? new DateConverter() : new DateConverter(null)); register(Calendar.class, throwException ? new CalendarConverter() : new CalendarConverter(null)); register(File.class, throwException ? new FileConverter() : new FileConverter(null)); register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null)); register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null)); register(Timestamp.class, throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null)); register(URL.class, throwException ? new URLConverter() : new URLConverter(null)); }
/** * Register the converters for other types. * </p> * This method registers the following converters: * <ul> * <li><code>Class.class</code> - {@link ClassConverter}</li> * <li><code>java.util.Date.class</code> - {@link DateConverter}</li> * <li><code>java.util.Calendar.class</code> - {@link CalendarConverter}</li> * <li><code>File.class</code> - {@link FileConverter}</li> * <li><code>java.sql.Date.class</code> - {@link SqlDateConverter}</li> * <li><code>java.sql.Time.class</code> - {@link SqlTimeConverter}</li> * <li><code>java.sql.Timestamp.class</code> - {@link SqlTimestampConverter}</li> * <li><code>URL.class</code> - {@link URLConverter}</li> * </ul> * @param throwException <code>true</code> if the converters should * throw an exception when a conversion error occurs, otherwise <code> * <code>false</code> if a default value should be used. */ private void registerOther(boolean throwException) { register(Class.class, throwException ? new ClassConverter() : new ClassConverter(null)); register(java.util.Date.class, throwException ? new DateConverter() : new DateConverter(null)); register(Calendar.class, throwException ? new CalendarConverter() : new CalendarConverter(null)); register(File.class, throwException ? new FileConverter() : new FileConverter(null)); register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null)); register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null)); register(Timestamp.class, throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null)); register(URL.class, throwException ? new URLConverter() : new URLConverter(null)); }
registerArrayConverter(Calendar.class, new DateConverter(), throwException, defaultArraySize); registerArrayConverter(File.class, new FileConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Date.class, new SqlDateConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Time.class, new SqlTimeConverter(), throwException, defaultArraySize); registerArrayConverter(Timestamp.class, new SqlTimestampConverter(), throwException, defaultArraySize);
registerArrayConverter(Calendar.class, new DateConverter(), throwException, defaultArraySize); registerArrayConverter(File.class, new FileConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Date.class, new SqlDateConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Time.class, new SqlTimeConverter(), throwException, defaultArraySize); registerArrayConverter(Timestamp.class, new SqlTimestampConverter(), throwException, defaultArraySize);
registerArrayConverter(Calendar.class, new DateConverter(), throwException, defaultArraySize); registerArrayConverter(File.class, new FileConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Date.class, new SqlDateConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Time.class, new SqlTimeConverter(), throwException, defaultArraySize); registerArrayConverter(Timestamp.class, new SqlTimestampConverter(), throwException, defaultArraySize);
registerArrayConverter(Calendar.class, new DateConverter(), throwException, defaultArraySize); registerArrayConverter(File.class, new FileConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Date.class, new SqlDateConverter(), throwException, defaultArraySize); registerArrayConverter(java.sql.Time.class, new SqlTimeConverter(), throwException, defaultArraySize); registerArrayConverter(Timestamp.class, new SqlTimestampConverter(), throwException, defaultArraySize);