In case value is null or an empty string the defValue is returned

@param value
@param defValue
@param errorMsgOnParseFailure
@return the converted int.
@throws SearchException if value can't be parsed.
320426
public static final int parseInt(String value, int defValue, String errorMsgOnParseFailure) {
      if (StringHelper.isEmpty(value)) {
         return defValue;
      } else {
         return parseInt(value, errorMsgOnParseFailure);
      }
   }
722465
private String generateInvalidErrorMessage(Object[] enumValues, String testValue)
    {
        StringBuffer errorMessage = new StringBuffer("Unable to convert value [" + testValue + "].");

        errorMessage.append(" Allowed values are (case insensitive) ");

        StringBuffer valueList = new StringBuffer();

        int index = 1;
        for (Object enumValue : enumValues) {
            if (valueList.length() > 0) {
                if (++index == enumValues.length) {
                    valueList.append(" or ");
                } else {
                    valueList.append(", ");
                }
            }

            valueList.append('"');
            valueList.append(enumValue);
            valueList.append('"');
        }

        errorMessage.append(valueList);
        errorMessage.append('.');

        return errorMessage.toString();
    }
567229
public void rejectValue(final String field, final String errorCode, 
            final Map<String, Object> messageVariables, final String defaultMessage) {
        
        rejectValue(field, null, errorCode, Collections.emptyMap(), defaultMessage);
        
    }
98744
function parseViewValue(value) {
                if (angular.isUndefined(value)) {
                    value = '';
                }
                value = (""+value).replace(decimalSeparator, '.');

                // Handle leading decimal point, like ".5"
                if (value.indexOf('.') === 0) {
                    value = '0' + value;
                }

                // Allow "-" inputs only when min < 0
                if (value.indexOf('-') === 0) {
                    if (min >= 0) {
                        value = null;
                        ngModelCtrl.$setViewValue(formatViewValue(lastValidValue));
                        ngModelCtrl.$render();
                    }
                    else if (value === '-') {
                        value = '';
                    }
                }

                var empty = ngModelCtrl.$isEmpty(value);
                if (empty) {
                    lastValidValue = '';
                    //ngModelCtrl.$modelValue = undefined;
                } 
                else {
                    if (regex.test(value) && (value.length <= maxInputLength)) {
                        if ((value > max) && limitMax) {
                            lastValidValue = max;
                        }
                        else if ((value < min) && limitMin) {
                            lastValidValue = min;
                        }
                        else {
                            lastValidValue = (value === '') ? null : parseFloat(value);
                        }
                    }
                    else {
                        // Render the last valid input in the field
                        ngModelCtrl.$setViewValue(formatViewValue(lastValidValue));
                        ngModelCtrl.$render();
                    }
                }

                return lastValidValue;
            }
235900
public FormInputValidator valueGreaterThan (VisValidatableTextField field, String errorMsg, float value) {
		return valueGreaterThan(field, errorMsg, value, false);
	}
908348
public int getIntValue(String name, int defaultValue)
            throws NumberFormatException {

        String value = getValue(name);

        if (value == null) {
            return defaultValue;
        } else {
            return Integer.parseInt(value);
        }
    }
26901
public static <T extends CharSequence> T validateMobile(T value, String errorMsg) throws ValidateException {
		if (false == isMobile(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
419655
function parseCustomValue(value, parse) {
  try {
    let parsed = parse(value)
    if (parsed === undefined) {
      return { value: null }
    }
    return { value: parsed }
  } catch (error) {
    return { error: error.message }
  }
}
392412
public TypeBindException newTypeBindExceptionOnParse(final Exception error,  final Cell cell, final Object cellValue) {

        final String message = MessageBuilder.create("cell.typeBind.failParse")
                .var("property", field.getNameWithClass())
                .var("cellAddress", POIUtils.formatCellAddress(cell))
                .var("cellValue", cellValue.toString())
                .varWithClass("type", field.getType())
                .format();

        final TypeBindException bindException = new TypeBindException(error, message, field.getType(), cellValue);
        if(error instanceof TextParseException) {
            bindException.addAllMessageVars(((TextParseException)error).getErrorVariables());
        }

        return bindException;

    }
285294
public static <T extends CharSequence> T validateWord(T value, String errorMsg) throws ValidateException {
		if (false == isWord(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
1109860
public static <T extends CharSequence> T validateUrl(T value, String errorMsg) throws ValidateException {
		if (false == isUrl(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
1122134
public static Double toDoubleObject(@Nullable String str, Double defaultValue) {
		if (StringUtils.isEmpty(str)) {
			return defaultValue;
		}
		try {
			return Double.valueOf(str);
		} catch (final NumberFormatException nfe) {
			return defaultValue;
		}
	}
454531
public double getRequstURILastPath(double defvalue) {
        String val = getRequstURILastPath();
        try {
            return val.isEmpty() ? defvalue : Double.parseDouble(val);
        } catch (NumberFormatException e) {
            return defvalue;
        }
    }
170407
public static Integer readInteger(String value, Integer defaultValue) {
		if (!StringUtils.hasText(value)) return defaultValue;
		
		return Integer.valueOf(value);
	}
1143006
public float getRequstURILastPath(float defvalue) {
        String val = getRequstURILastPath();
        try {
            return val.isEmpty() ? defvalue : Float.parseFloat(val);
        } catch (NumberFormatException e) {
            return defvalue;
        }
    }
269117
private CellFormatResult getErrorCellValue(final byte errorValue, final Locale locale) {

       final FormulaError error = FormulaError.forInt(errorValue);
       final CellFormatResult result = new CellFormatResult();
       result.setCellType(FormatCellType.Error);
       result.setValue(error.getCode());

       if(isErrorCellAsEmpty()) {
           result.setText("");
       } else {
           result.setText(error.getString());
       }

       return result;

    }
834104
public static <T extends CharSequence> T validateGeneral(T value, int min, String errorMsg) throws ValidateException {
		return validateGeneral(value, min, 0, errorMsg);
	}