Here you can find the source of isNumericAndCanNull(String src)
public static boolean isNumericAndCanNull(String src)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isNumericAndCanNull(String src) { Pattern numericPattern = Pattern.compile("^[0-9]+$"); if (src == null || src.equals("")) return true; boolean return_value = false; if (src != null && src.length() > 0) { Matcher m = numericPattern.matcher(src); if (m.find()) { return_value = true; }//from w ww . j av a2 s . c om } return return_value; } }