Package br.com.caelum.vraptor.converter

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


      // 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


    public UploadedFile convert(String value, Class<? extends UploadedFile> type, ResourceBundle bundle) {
        Object upload = request.getAttribute(value);
        if (upload == null) {
          logger.warn("There was an error when uploading the file {}. " +
              "Please verify if commons-fileupload jars are in your classpath or you are using a Servlet 3 Container.");
          throw new ConversionError("Invalid upload");
        }
    return type.cast(upload);
    }
View Full Code Here

      contexts.put(ctx.getRoot(), ctx);
    } catch (MethodFailedException e) { // setter threw an exception

      Throwable cause = e.getCause();
      if (cause.getClass().isAnnotationPresent(ValidationException.class)) {
        throw new ConversionError(cause.getLocalizedMessage());
      } else {
        throw new InvalidParameterException("unable to parse expression '" + key + "'", e);
      }

    } catch (NoSuchPropertyException ex) {
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.