List of usage examples for org.apache.commons.validator GenericValidator isByte
public static boolean isByte(String value)
Checks if the value can safely be converted to a byte primitive.
From source file:com.core.validators.CommonValidator.java
/** * Checks if the field can be successfully converted to a <code>byte</code>. * * @param value The value validation is being performed on. * @return boolean If the field can be successfully converted * to a <code>byte</code> <code>true</code> is returned. * Otherwise <code>false</code>. *///from ww w .j a va 2s . co m public static boolean validateByte(Object bean, Field field) { String value = ValidatorUtils.getValueAsString(bean, field.getProperty()); return GenericValidator.isByte(value); }