code: public static List<Integer> toIntegerList(List<String> strList, boolean failOnException){
  		List<Integer> intList = new ArrayList<Integer>();
  		for(String str : strList){
  			try{
  				intList.add(Integer.parseInt(str));
  			}
  			catch(NumberFormatException nfe){
  				if(failOnException){
  					return null;
  				}
  				else{
  					intList.add(null);
  				}
  			}
  		}
  		return intList;
  	}
docs: Parse a list of String into a list of Integer.
  If one element can not be parsed, the behavior depends on the value of failOnException.
  @param strList can't be null
  @param failOnException if an element can not be parsed should we return null or add a null element to the list.
  @return list of all String parsed as Integer or null if failOnException