List of usage examples for org.apache.commons.validator.routines BigDecimalValidator isValid
public boolean isValid(String value)
Validate using the default Locale.
From source file:org.mule.modules.validation.ValidationModule.java
/** * If the specified <code>percentage</code> is not a valid one throw an exception. * <p/>//from ww w . ja va2s.c om * {@sample.xml ../../../doc/mule-module-validation.xml.sample validation:validate-percentage} * * @param percentage Percentage to validate * @param customExceptionClassName Class name of the exception to throw * @throws Exception if not valid */ @Processor public void validatePercentage(String percentage, @Optional @Default("org.mule.modules.validation.InvalidException") String customExceptionClassName) throws Exception { BigDecimalValidator validator = PercentValidator.getInstance(); if (!validator.isValid(percentage)) { throw buildException(customExceptionClassName); } }