Examples of CalendarConverter


Examples of org.apache.commons.beanutils.converters.CalendarConverter

     * <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));
View Full Code Here

Examples of org.apache.commons.beanutils.converters.CalendarConverter

     * <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));
View Full Code Here

Examples of org.apache.commons.beanutils.converters.CalendarConverter

     * <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));
View Full Code Here

Examples of org.apache.commons.beanutils.converters.CalendarConverter

     * <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));
View Full Code Here

Examples of org.apache.commons.beanutils.converters.CalendarConverter

     * <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));
View Full Code Here

Examples of org.apache.commons.beanutils.converters.CalendarConverter

   * @throws IllegalAccessException
   */
  public static Object buildEntity(BaseBO baseBO, Object obj) throws IllegalAccessException, InvocationTargetException {
    final BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance();
   
    beanUtilsBean.getConvertUtils().register(new CalendarConverter( null), Calendar.class);
    beanUtilsBean.getConvertUtils().register(new IntegerConverter( null), Integer.class);
    beanUtilsBean.getConvertUtils().register(new LongConverter(null), Long.class);
   
    beanUtilsBean.copyProperties(obj, baseBO);
   
View Full Code Here

Examples of org.apache.commons.beanutils.converters.CalendarConverter

   * @throws IllegalAccessException
   */
  public static BaseBO buildBO(Object obj, BaseBO baseBO) throws IllegalAccessException, InvocationTargetException {
    final BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance();
   
    beanUtilsBean.getConvertUtils().register(new CalendarConverter( null), Calendar.class);
    beanUtilsBean.getConvertUtils().register(new IntegerConverter( null), Integer.class);
    beanUtilsBean.getConvertUtils().register(new LongConverter(null), Long.class);
   
    beanUtilsBean.copyProperties(baseBO, obj);
   
View Full Code Here

Examples of org.apache.wicket.util.convert.converter.CalendarConverter

   * Test calendar locale conversions.
   */
  @Test
  public void calendarConverter()
  {
    CalendarConverter converter = new CalendarConverter();

    Calendar cal = Calendar.getInstance(DUTCH_LOCALE);
    cal.clear();
    cal.set(2011, Calendar.MAY, 1);

    assertEquals("1-5-11", converter.convertToString(cal, DUTCH_LOCALE));
    assertEquals(cal, converter.convertToObject("1-5-11", DUTCH_LOCALE));

    cal = Calendar.getInstance(Locale.US);
    cal.clear();
    cal.set(2011, Calendar.MAY, 1);
    assertEquals("5/1/11", converter.convertToString(cal, Locale.US));
    assertEquals(cal, converter.convertToObject("5/1/11", Locale.US));

    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
    }
    try
    {
      converter.convertToObject("5/1/11whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
View Full Code Here

Examples of org.apache.wicket.util.convert.converter.CalendarConverter

    set(BigInteger.class, new BigIntegerConverter());
    set(Date.class, new DateConverter());
    set(java.sql.Date.class, new SqlDateConverter());
    set(java.sql.Time.class, new SqlTimeConverter());
    set(java.sql.Timestamp.class, new SqlTimestampConverter());
    set(Calendar.class, new CalendarConverter());
  }
View Full Code Here

Examples of org.apache.wicket.util.convert.converter.CalendarConverter

    set(BigInteger.class, new BigIntegerConverter());
    set(Date.class, new DateConverter());
    set(java.sql.Date.class, new SqlDateConverter());
    set(java.sql.Time.class, new SqlTimeConverter());
    set(java.sql.Timestamp.class, new SqlTimestampConverter());
    set(Calendar.class, new CalendarConverter());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.