Package org.pirkaengine.form.exception

Examples of org.pirkaengine.form.exception.ConvertException


    protected Date convert(String text) {
        if (text == null || text.isEmpty()) return null;
        try {
            return new SimpleDateFormat(dateFormat).parse(text);
        } catch (ParseException e) {
            throw new ConvertException(e, dateFormat);
        }
    }
View Full Code Here


     * @see org.pirkaengine.form.field.BaseField#convert(java.lang.String)
     */
    @Override
    protected String convert(String text) {
        if (text == null || text.isEmpty()) return null;
        if (!options.isEmpty() && !options.contains(text)) throw new ConvertException(options.toString());
        return text;
    }
View Full Code Here

    protected Integer convert(String text) {
        if (text == null || text.isEmpty()) return null;
        try {
            return Integer.parseInt(text);
        } catch (NumberFormatException e) {
            throw new ConvertException(e);
        }
    }
View Full Code Here

    protected Float convert(String text) throws ConvertException {
        if (text == null || text.isEmpty()) return null;
        try {
            return Float.parseFloat(text);
        } catch (NumberFormatException e) {
            throw new ConvertException(e);
        }
    }
View Full Code Here

    protected T convert(String text) {
        if (text == null || text.isEmpty()) return null;
        try {
            return Enum.valueOf(enumClass, text);
        } catch (IllegalArgumentException e) {
            throw new ConvertException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.pirkaengine.form.exception.ConvertException

Copyright © 2018 www.massapicom. 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.