Examples of FieldIllegalValueException


Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

                        value = sdFormat.parse(dateValue);
                        // OK
                    } catch (ParseException e)
                    {   // Error
                        log.info("Parsing '{}' to Date ("+datePattern+") failed for column {}. Message is "+e.toString(), value, getName());
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }   
                break;

            case DECIMAL:
                if (value==null)
                    break;
                if (!(value instanceof java.lang.Number))
                {   try
                    {   // Convert to String and check
                        value = ObjectUtils.toDecimal(value);
                        // throws NumberFormatException if not a number!
                    } catch (NumberFormatException e)
                    {
                        log.info("Parsing '{}' to Decimal failed for column {}. Message is "+e.toString(), value, getName());
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                // validate Number
                validateNumber(type, (Number)value);
                break;

            case FLOAT:
                if (value==null)
                    break;
                if (!(value instanceof java.lang.Number))
                {   try
                    {   // Convert to String and check
                        value = ObjectUtils.toDouble(value);
                        // throws NumberFormatException if not a number!
                    } catch (NumberFormatException e)
                    {
                        log.info("Parsing '{}' to Double failed for column {}. Message is "+e.toString(), value, getName());
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                // validate Number
                validateNumber(type, (Number)value);
                break;

            case INTEGER:
                if (value==null)
                    break;
                if (!(value instanceof java.lang.Number))
                {   try
                    {   // Convert to String and check
                        value = ObjectUtils.toLong(value);
                        // throws NumberFormatException if not an integer!
                    } catch (NumberFormatException e)
                    {
                        log.info("Parsing '{}' to Integer failed for column {}. Message is "+e.toString(), value, getName());
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                // validate Number
                validateNumber(type, (Number)value);
                break;
View Full Code Here

Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

            super.validate(context);
           
        } catch(Exception e) {
            // Value is not valid
            if (!(e instanceof EmpireException))
                e = new FieldIllegalValueException(helper.getColumn(), "", e);
            // Add error message
            helper.addErrorMessage(context, e);
            setValid(false);
        }
    }
View Full Code Here

Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

            super.validate(context);
           
        } catch(Exception e) {
            // Value is not valid
            if (!(e instanceof EmpireException))
                e = new FieldIllegalValueException(helper.getColumn(), "", e);
            // Add error message
            helper.addErrorMessage(context, e);
            setValid(false);
        }
    }
View Full Code Here

Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

            super.validate(context);
           
        } catch(Exception e) {
            // Value is not valid
            if (!(e instanceof EmpireException))
                e = new FieldIllegalValueException(helper.getColumn(), "", e);
            // Add error message
            helper.addErrorMessage(context, e);
            setValid(false);
        }
    }
View Full Code Here

Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

                    }                         
                        // OK
                    } catch (ParseException e)
                    {   // Error
                        log.error("checkValue failed: " + e.toString() + " column=" + getName() + " value=" + value);
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }   
                break;

            case DECIMAL:
            case FLOAT:
                if (value!=null && (value instanceof java.lang.Number)==false)
                {   try
                    {   // Convert to String and check
                        String val = value.toString();
                        if (val.length() > 0)
                            Double.parseDouble(val);
                        // thows NumberFormatException if not a number!
                    } catch (NumberFormatException e)
                    {
                        log.error("checkValue exception: " + e.toString() + " column=" + getName() + " value=" + value);
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                break;

            case INTEGER:
                if (value!=null && (value instanceof java.lang.Number)==false)
                {   try
                    {   // Convert to String and check
                        String val = value.toString();
                        if (val.length() > 0)
                            Long.parseLong(val);
                        // throws NumberFormatException if not an integer!
                    } catch (NumberFormatException e)
                    {
                        log.error("checkValue exception: " + e.toString() + " column=" + getName() + " value=" + String.valueOf(value));
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                break;

            case TEXT:
View Full Code Here

Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

            super.validate(context);
           
        } catch(Exception e) {
            // Value is not valid
            if (!(e instanceof EmpireException))
                e = new FieldIllegalValueException(helper.getColumn(), "", e);
            // Add error message
            helper.addErrorMessage(context, e);
            setValid(false);
        }
    }
View Full Code Here

Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

                        sdFormat.parse(value.toString());
                        // OK
                    } catch (ParseException e)
                    {   // Error
                        log.error("checkValue failed: " + e.toString() + " column=" + getName() + " value=" + value);
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }   
                break;

            case DECIMAL:
            case FLOAT:
                if (value!=null && (value instanceof java.lang.Number)==false)
                {   try
                    {   // Convert to String and check
                        String val = value.toString();
                        if (val.length() > 0)
                            Double.parseDouble(val);
                        // thows NumberFormatException if not a number!
                    } catch (NumberFormatException e)
                    {
                        log.error("checkValue exception: " + e.toString() + " column=" + getName() + " value=" + value);
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                break;

            case INTEGER:
                if (value!=null && (value instanceof java.lang.Number)==false)
                {   try
                    {   // Convert to String and check
                        String val = value.toString();
                        if (val.length() > 0)
                            Long.parseLong(val);
                        // throws NumberFormatException if not an integer!
                    } catch (NumberFormatException e)
                    {
                        log.error("checkValue exception: " + e.toString() + " column=" + getName() + " value=" + String.valueOf(value));
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                break;

            case TEXT:
View Full Code Here

Examples of org.apache.empire.db.exceptions.FieldIllegalValueException

                    }                         
                        // OK
                    } catch (ParseException e)
                    {   // Error
                        log.error("checkValue failed: " + e.toString() + " column=" + getName() + " value=" + value);
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }   
                break;

            case DECIMAL:
            case FLOAT:
                if (value!=null && (value instanceof java.lang.Number)==false)
                {   try
                    {   // Convert to String and check
                        String val = value.toString();
                        if (val.length() > 0)
                            Double.parseDouble(val);
                        // thows NumberFormatException if not a number!
                    } catch (NumberFormatException e)
                    {
                        log.error("checkValue exception: " + e.toString() + " column=" + getName() + " value=" + value);
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                break;

            case INTEGER:
                if (value!=null && (value instanceof java.lang.Number)==false)
                {   try
                    {   // Convert to String and check
                        String val = value.toString();
                        if (val.length() > 0)
                            Long.parseLong(val);
                        // throws NumberFormatException if not an integer!
                    } catch (NumberFormatException e)
                    {
                        log.error("checkValue exception: " + e.toString() + " column=" + getName() + " value=" + String.valueOf(value));
                        throw new FieldIllegalValueException(this, String.valueOf(value), e);
                    }
                }
                break;

            case TEXT:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.