code: public static int parseInteger(String attrVal) {
          if (attrVal == null) {
              return Integer.MIN_VALUE;
          }
          Matcher m = INTEGER_PATTERN.matcher(attrVal);
          if (!m.matches()) {
              return Integer.MIN_VALUE;
          }
          try {
              return Integer.parseInt(m.group(1));
          } catch (NumberFormatException e) {
              return Integer.MIN_VALUE;
          }
      }
docs: Returns the integer represented by <code>attrVal</code> or
  <code>Integer.MIN_VALUE</code> on error.
  
  @param attrVal a string representing an integer attribute
  value (can be <code>null</code>)
  @return the integer represented by <code>attrVal</code> or
  <code>Integer.MIN_VALUE</code> on error