Examples of ValueParseException


Examples of org.apache.isis.application.value.ValueParseException

            clear();
        } else {
            int dash = text.indexOf("~");

            if (dash == -1) {
                throw new ValueParseException("No tilde found");
            }
            Date sd = new Date();
            Date ed = new Date();
            sd.parseUserEntry(text.substring(0, dash).trim());
            ed.parseUserEntry(text.substring(dash + 1).trim());

            if (ed.isLessThan(sd)) {
                throw new ValueParseException("End date must be before start date");
            }
            setValue(sd, ed);
        }
    }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

            clear();
        } else {
            try {
                setValue(FORMAT.parse(text).doubleValue());
            } catch (ParseException e) {
                throw new ValueParseException("Invalid number", e);
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

                        cal.setTime(formats[i].parse(text));

                        break;
                    } catch (ParseException e) {
                        if ((i + 1) == formats.length) {
                            throw new ValueParseException("Invalid time '" + text + "' for locale " + Locale.getDefault(), e);
                        }
                    }
                }
            }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

                    try {
                        cal.setTime(formats[i].parse(dateString));
                        break;
                    } catch (ParseException e) {
                        if ((i + 1) == formats.length) {
                            throw new ValueParseException("Invalid date " + dateString, e);
                        }
                    }
                }

            }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

            clear();
        } else {
            try {
                setValue(FORMAT.parse(text).longValue());
            } catch (ParseException e) {
                throw new ValueParseException("Invalid number", e);
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

            } catch (ParseException tryAgain) {
                try {
                    // amount = NUMBER_FORMAT.parse(text).doubleValue();
                    setValue(NUMBER_FORMAT.parse(text).doubleValue());
                } catch (ParseException e) {
                    throw new ValueParseException("Invalid number", e);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

            if (tilde >= 0) {
                st.parseUserEntry(text.substring(0, tilde).trim());
                et.parseUserEntry(text.substring(tilde + 1).trim());
            } else {
                // Not sure how to specify the type of the Exception
                throw new ValueParseException("No tilde found", new Exception());
            }

            if (et.isLessThan(st)) {
                throw new ValueParseException("End time before start time", new Exception());
            }
            setValue(st, et);
        }
    }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

                        cal.setTime(formats[i].parse(text));

                        break;
                    } catch (ParseException e) {
                        if ((i + 1) == formats.length) {
                            throw new ValueParseException("Invalid timeStamp " + text, e);
                        }
                    }
                }
            }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

            clear();
        } else {
            try {
                setValue(FORMAT.parse(text).intValue());
            } catch (ParseException e) {
                throw new ValueParseException("Invalid number", e);
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.application.value.ValueParseException

                    setValue(Integer.parseInt(text.substring(1), 16));
                } else {
                    setValue(Integer.parseInt(text));
                }
            } catch (NumberFormatException e) {
                throw new ValueParseException("Invalid number", e);
            }
        }
    }
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.