All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.excel.tools.validator.cell.LongValidator Maven / Gradle / Ivy

The newest version!
package me.excel.tools.validator.cell;

import me.excel.tools.model.excel.ExcelCell;

/**
 * long validator
 * 

* Created by hanwen on 5/3/16. */ public class LongValidator extends CellValidatorAdapter { public LongValidator(String matchField) { super(matchField, "应该为整数"); } public LongValidator(String matchField, String errorMessage) { super(matchField, errorMessage); } @Override protected boolean customValidate(ExcelCell excelCell) { try { Long.parseLong(excelCell.getValue()); } catch (NumberFormatException e) { return false; } return true; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy