Examples of ConversionError


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

            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

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

    try {
      return converter.convert(value, type, null);
    } catch (ConversionException e) {
      // prints stack trace because its an internal problem that ocurred
      e.printStackTrace();
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_valid"), value));
    }
  }
View Full Code Here

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

    try {
      return converter.convert(value, type, null);
    } catch (ConversionException e) {
      // prints stack trace because its an internal problem that ocurred
      e.printStackTrace();
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_valid"), value));
    }
  }
View Full Code Here

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

            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

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

            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

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

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

            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

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

      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

Examples of org.openbel.framework.core.ConversionError

        } catch (JAXBException e) {
            e.printStackTrace();
            final String name = d.getName();
            final String msg = e.getMessage();
            final Throwable cause = e;
            throw new ConversionError(name, msg, cause);
        } catch (IOException e) {
            final String name = d.getName();
            final String msg = e.getMessage();
            final Throwable cause = e;
            throw new ConversionError(name, msg, cause);
        }
    }
View Full Code Here

Examples of org.openbel.framework.core.ConversionError

            return document;
        } catch (JAXBException e) {
            final String name = f.getAbsolutePath();
            final String msg = e.getMessage();
            final Throwable cause = e;
            throw new ConversionError(name, msg, cause);
        } catch (IOException e) {
            final String name = f.getAbsolutePath();
            final String msg = e.getMessage();
            final Throwable cause = e;
            throw new ConversionError(name, msg, cause);
        }

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