Package br.com.caelum.vraptor.converter

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


      Calendar calendar = iso8601.toCalendar(value);

      return calendar;
    } catch (ParseException e) {
      throw new ConversionError("Error to convert Calendar: "  + e.getMessage());
    }
  }
View Full Code Here


      final Locale locale = localization.getLocale();
      DecimalFormat fmt = ((DecimalFormat) DecimalFormat.getInstance(locale));
 
      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

      final Locale locale = localization.getLocale();
      DecimalFormat fmt = ((DecimalFormat) DecimalFormat.getInstance(locale));
 
      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 = ((DecimalFormat) DecimalFormat.getInstance(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

      final Locale locale = localization.getLocale();
      DecimalFormat fmt = ((DecimalFormat) DecimalFormat.getInstance(locale));
 
      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

      final Locale locale = localization.getLocale();
      DecimalFormat fmt = ((DecimalFormat) DecimalFormat.getInstance(locale));

      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

      }

      return calendar;
    }
    catch (JsonParseException e) {
      throw new ConversionError("Invalid Json format to convert Calendar: " + e.getMessage());
    }
    catch (ParseException e) {
      throw new ConversionError("Error to convert Calendar: " + e.getMessage());
    }
  }
View Full Code Here

            final Locale locale = localization.getLocale();
            DecimalFormat fmt = ((DecimalFormat) DecimalFormat.getInstance(locale));

            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

            final Locale locale = localization.getLocale();
            DecimalFormat fmt = ((DecimalFormat) DecimalFormat.getInstance(locale));

      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

      Date date = format.parse(value);
      Calendar calendar = new GregorianCalendar();
      calendar.setTime(date);
      return calendar;
    } catch (ParseException e) {
      throw new ConversionError("Error to convert Calendar.");
    }

  }
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.