I normally use the following idiom to check if a String can be converted to an integer.
public boolean isInteger( String input ) { try { Integer.
You just check NumberFormatException:-
String value="123"; try { int s=Integer.parseInt(any_int_val); // do something when integer values comes } catch(NumberFormatException nfe) { // do something when string values comes }