Package org.apache.tapestry

Examples of org.apache.tapestry.ValidationException


        {
            return new Double(clientValue.trim());
        }
        catch (NumberFormatException ex)
        {
            throw new ValidationException(messages.format("number-format-exception", clientValue));
        }
    }
View Full Code Here


        {
            return new Long(clientValue.trim());
        }
        catch (NumberFormatException ex)
        {
            throw new ValidationException(messages.format("integer-format-exception", clientValue));
        }
    }
View Full Code Here

        {
            return new Integer(clientValue.trim());
        }
        catch (NumberFormatException ex)
        {
            throw new ValidationException(messages.format("integer-format-exception", clientValue));
        }
    }
View Full Code Here

        {
            return new Double(clientValue.trim());
        }
        catch (NumberFormatException ex)
        {
            throw new ValidationException(messages.format("number-format-exception", clientValue));
        }
    }
View Full Code Here

    void onValidateFromCount(Integer count) throws ValidationException
    {
        // count may be null
        if (count == null) return;

        if (count.equals(13)) throw new ValidationException("Thirteen is an unlucky number.");
    }
View Full Code Here

    public void validate(Field field, Integer constraintValue, MessageFormatter formatter, String value)
            throws ValidationException
    {
        if (value.length() < constraintValue)
            throw new ValidationException(buildMessage(formatter, field, constraintValue));
    }
View Full Code Here

    }

    public void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value)
            throws ValidationException
    {
        if (value == null || value.toString().equals("")) throw new ValidationException(buildMessage(formatter, field));
    }
View Full Code Here

    public void validate(Field field, Long constraintValue, MessageFormatter formatter, Number value)
            throws ValidationException
    {
        if (value.longValue() < constraintValue)
            throw new ValidationException(buildMessage(formatter, field, constraintValue));
    }
View Full Code Here

    public void validate(Field field, Long constraintValue, MessageFormatter formatter, Number value)
            throws ValidationException
    {
        if (value.longValue() > constraintValue)
            throw new ValidationException(buildMessage(formatter, field, constraintValue));
    }
View Full Code Here

    public void validate(Field field, Pattern constraintValue, MessageFormatter formatter, String value)
            throws ValidationException
    {
        Matcher matcher = constraintValue.matcher(value);

        if (!matcher.matches()) throw new ValidationException(buildMessage(formatter, field, constraintValue));
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ValidationException

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.