Package br.com.caelum.vraptor.converter

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


    }
   
    try {
      return getFormatter().parseLocalDateTime(value);
    } catch (UnsupportedOperationException | IllegalArgumentException  e) {
      throw new ConversionException(new ConversionMessage("is_not_a_valid_datetime", value));
    }
  }
View Full Code Here


    }
   
    try {
      return getFormatter().parseLocalTime(value);
    } catch (UnsupportedOperationException | IllegalArgumentException  e) {
      throw new ConversionException(new ConversionMessage("is_not_a_valid_time", value));
    }
  }
View Full Code Here

    final Matcher<? extends String> delegate = equalTo(message);
    return new TypeSafeMatcher<Exception>() {
      @Override
      protected boolean matchesSafely(Exception item) {
        if (item instanceof ConversionException) {
          ConversionMessage message = ((ConversionException) item).getValidationMessage();
          message.setBundle(ResourceBundle.getBundle("messages"));
          return delegate.matches(message.getMessage());
        }

        return false;
      }
View Full Code Here

    try {
      return Long.valueOf(value);
    } catch (NumberFormatException e) {
      throw new ConversionException(
        new ConversionMessage("is_not_a_valid_integer", value));
    }
  }
View Full Code Here

TOP

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

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.