Example usage for org.apache.commons.validator.routines IntegerValidator validate

List of usage examples for org.apache.commons.validator.routines IntegerValidator validate

Introduction

In this page you can find the example usage for org.apache.commons.validator.routines IntegerValidator validate.

Prototype

public Integer validate(String value, Locale locale) 

Source Link

Document

Validate/convert an Integer using the specified Locale.

Usage

From source file:com.iana.boesc.utility.BOESCUtil.java

/**
 * Validates whether clients data is Integer or not
 * //w ww.  j a  v a 2 s  . c  o m
 * @param integer
 * @return
 */
public static boolean IntegerValidator(String integer) {
    if (integer == null || integer.trim().equals("")) {
        return false;
    }
    IntegerValidator validator = IntegerValidator.getInstance();
    Integer integerVal = validator.validate(integer, "#,##0.00");
    if (integerVal == null) {
        return false;
    }
    return true;
}