empire-db-jakarta-faces/src/main/java/org/apache/empire/jakarta/controls/TextInputControl.java [137:172]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public Object getAsObject(FacesContext context, UIComponent component, String value)
        {
            if (ObjectUtils.isEmpty(value))
                return null;
            try
            {   // parse
                if (nf==null)
                    return new BigDecimal(value);
                // parse now
                Number number = nf.parse(value);
                if (number instanceof BigDecimal)
                {   // Round to scale
                    int scale = nf.getMaximumFractionDigits();
                    number = ((BigDecimal)number).setScale(scale, RoundingMode.HALF_UP);
                }
                return number;
            }
            catch (ParseException e)
            {   // find column
                UIComponent inputComp = component.getParent();
                while (inputComp!=null) {
                    // set the tag
                    if ((inputComp instanceof InputTag) || (inputComp instanceof ControlTag))
                    {   // Found an InputTag or ControlTag
                        Object column = inputComp.getAttributes().get("column");
                        if (column instanceof Column)
                            throw new FieldIllegalValueException((Column)column, value);
                    }
                    inputComp = inputComp.getParent();
                    if (inputComp instanceof HtmlForm)
                        break;
                }
                // Just throw an InvalidValueException
                throw new InvalidValueException(value);
            }
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java [137:172]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public Object getAsObject(FacesContext context, UIComponent component, String value)
        {
            if (ObjectUtils.isEmpty(value))
                return null;
            try
            {   // parse
                if (nf==null)
                    return new BigDecimal(value);
                // parse now
                Number number = nf.parse(value);
                if (number instanceof BigDecimal)
                {   // Round to scale
                    int scale = nf.getMaximumFractionDigits();
                    number = ((BigDecimal)number).setScale(scale, RoundingMode.HALF_UP);
                }
                return number;
            }
            catch (ParseException e)
            {   // find column
                UIComponent inputComp = component.getParent();
                while (inputComp!=null) {
                    // set the tag
                    if ((inputComp instanceof InputTag) || (inputComp instanceof ControlTag))
                    {   // Found an InputTag or ControlTag
                        Object column = inputComp.getAttributes().get("column");
                        if (column instanceof Column)
                            throw new FieldIllegalValueException((Column)column, value);
                    }
                    inputComp = inputComp.getParent();
                    if (inputComp instanceof HtmlForm)
                        break;
                }
                // Just throw an InvalidValueException
                throw new InvalidValueException(value);
            }
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



