I normally use the following idiom to check if a String can be converted to an integer.
public boolean isInteger( String input ) { try { Integer.
This works for me. Simply to identify whether a String is a primitive or a number.
private boolean isPrimitive(String value){ boolean status=true; if(value.length()<1) return false; for(int i = 0;i