public String getStringValue() { String result = StringUtils.EMPTY; if (value != null) { result = FormattersManager.getFormatter(type, getFormat()).format(value); } return result; }
public String getStringValue() { String result = StringUtils.EMPTY; if (value != null) { result = FormattersManager.getFormatter(type, getFormat()).format(value); } return result; }
/** * Setter for the property value as {@link String}. Income value will be parsed to the appropriate type. * That can be found calling {@link #getType()} method. * * @param value value of the property as String. */ public void setStringValue(String value) { Object result = value; if (StringUtils.isNotBlank(value)) { result = FormattersManager.getFormatter(type, getFormat()).parse(value); } else { result = null; } this.value = result; }
/** * Setter for the property value as {@link String}. Income value will be parsed to the appropriate type. * That can be found calling {@link #getType()} method. * * @param value value of the property as String. */ public void setStringValue(String value) { Object result = value; if (StringUtils.isNotBlank(value)) { result = FormattersManager.getFormatter(type, getFormat()).parse(value); } else { result = null; } this.value = result; }
/** * This is a setter for the value of the property. Value must be always typify. * This method is commonly used from UI. If property <code>{@link #isDateType()}</code>, * <code>{@link #isBooleanType()}</code> UI controls will be typify, and the income * value will be of the appropriate type. And if the income value is String we try * to parse it to the appropriate type. * * @param value a value of the property. */ public void setValue(Object value) { if (value instanceof String) { String valueStr = (String) value; if (StringUtils.isNotBlank(valueStr)) { value = FormattersManager.getFormatter(type, getFormat()).parse(valueStr); } else { value = null; } } this.value = value; }
/** * This is a setter for the value of the property. Value must be always typify. * This method is commonly used from UI. If property <code>{@link #isDateType()}</code>, * <code>{@link #isBooleanType()}</code> UI controls will be typify, and the income * value will be of the appropriate type. And if the income value is String we try * to parse it to the appropriate type. * * @param value a value of the property. */ public void setValue(Object value) { if (value instanceof String) { String valueStr = (String) value; if (StringUtils.isNotBlank(valueStr)) { value = FormattersManager.getFormatter(type, getFormat()).parse(valueStr); } else { value = null; } } this.value = value; }