empire-db-jakarta-faces/src/main/java/org/apache/empire/jakarta/controls/TextInputControl.java [323:366]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected Object parseInputValue(String value, InputInfo ii)
    {
        // Trim
        if (hasFormatOption(ii, "notrim") == false)
        {
            value = value.trim();
        }
        // Check Data Type
        Column column = ii.getColumn();
        DataType type = column.getDataType();
        if (type.isText())
        {
            return value;
        }
        // Check other types
        if (type == DataType.INTEGER)
        {   // get IntegerFormat and parse
            NumberFormat nf = NumberFormat.getIntegerInstance(ii.getLocale());
        	return parseNumber(value, nf);
        }
        if (type == DataType.DECIMAL || type == DataType.FLOAT)
        {   // get number format
            NumberFormat nf = getNumberFormat(type, ii, column);
            if (nf instanceof DecimalFormat)
                ((DecimalFormat)nf).setParseBigDecimal((type==DataType.DECIMAL));
            // parse
            return parseNumber(value, nf);
        }
        if (type == DataType.DATE || type == DataType.DATETIME || type == DataType.TIMESTAMP)
        {
            return parseDate(value, getDateFormat(column.getDataType(), ii, column));
        }
        if (type == DataType.BOOL)
        {
            return ObjectUtils.getBoolean(value);
        }
        if (type == DataType.AUTOINC)
        { // autoinc
            log.error("Autoinc-value cannot be changed.");
            return null;
        }
        // Default
        return value;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java [323:366]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected Object parseInputValue(String value, InputInfo ii)
    {
        // Trim
        if (hasFormatOption(ii, "notrim") == false)
        {
            value = value.trim();
        }
        // Check Data Type
        Column column = ii.getColumn();
        DataType type = column.getDataType();
        if (type.isText())
        {
            return value;
        }
        // Check other types
        if (type == DataType.INTEGER)
        {   // get IntegerFormat and parse
            NumberFormat nf = NumberFormat.getIntegerInstance(ii.getLocale());
        	return parseNumber(value, nf);
        }
        if (type == DataType.DECIMAL || type == DataType.FLOAT)
        {   // get number format
            NumberFormat nf = getNumberFormat(type, ii, column);
            if (nf instanceof DecimalFormat)
                ((DecimalFormat)nf).setParseBigDecimal((type==DataType.DECIMAL));
            // parse
            return parseNumber(value, nf);
        }
        if (type == DataType.DATE || type == DataType.DATETIME || type == DataType.TIMESTAMP)
        {
            return parseDate(value, getDateFormat(column.getDataType(), ii, column));
        }
        if (type == DataType.BOOL)
        {
            return ObjectUtils.getBoolean(value);
        }
        if (type == DataType.AUTOINC)
        { // autoinc
            log.error("Autoinc-value cannot be changed.");
            return null;
        }
        // Default
        return value;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



