Package br.com.caelum.vraptor.converter

Examples of br.com.caelum.vraptor.converter.ConversionError


      if (date == null) {
        return null;
      }
      return LocalDate.fromDateFields(date);
    } catch (Exception e) {
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_date"), value));
    }
  }
View Full Code Here


            DecimalFormat fmt = new DecimalFormat("##0,00", new DecimalFormatSymbols(locale));

            // DecimalFormat.parse can return long values, so it's more securely call floatValue
            return fmt.parse(value).floatValue();
        } catch (ParseException e) {
            throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_number"), value));
        }
    }
View Full Code Here

            DecimalFormat fmt = new DecimalFormat("##0,00", new DecimalFormatSymbols(locale));
            fmt.setParseBigDecimal(true);

            return (BigDecimal) fmt.parse(value);
        } catch (ParseException e) {
            throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_number"), value));
        }
    }
View Full Code Here

            DecimalFormat fmt = new DecimalFormat("##0,00", new DecimalFormatSymbols(locale));

            // DecimalFormat.parse can return long values, so it's more securely call floatValue
            return fmt.parse(value).doubleValue();
        } catch (ParseException e) {
            throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_number"), value));
        }
    }
View Full Code Here

      if (datetime == null) {
        return null;
      }
      return LocalDateTime.fromDateFields(datetime);
    } catch (Exception e) {
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value));
    }
  }
View Full Code Here

          if (time == null) {
            return null;
          }
          return LocalTime.fromDateFields(time);
        } catch (Exception e) {
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_time"), value));
        }
  }
View Full Code Here

      return null;
    }
    try {
            return LocalDate.fromCalendarFields(calendar);
        } catch (Exception e) {
          throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_date"), value));
        }
  }
View Full Code Here

      return null;
    }
    try {
            return LocalTime.fromCalendarFields(calendar);
        } catch (Exception e) {
          throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_date"), value));
        }
  }
View Full Code Here

            DecimalFormat fmt = new DecimalFormat("##0,00", new DecimalFormatSymbols(locale));

            // DecimalFormat.parse can return long values, so it's more securely call floatValue
            return fmt.parse(value).floatValue();
        } catch (ParseException e) {
            throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_number"), value));
        }
    }
View Full Code Here

            DecimalFormat fmt = new DecimalFormat("##0,00", new DecimalFormatSymbols(locale));
            fmt.setParseBigDecimal(true);

            return (BigDecimal) fmt.parse(value);
        } catch (ParseException e) {
            throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_number"), value));
        }
    }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.converter.ConversionError

Copyright © 2018 www.massapicom. 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.