Package org.apache.tapestry.valid

Examples of org.apache.tapestry.valid.ValidatorException


                                  "validatableFieldSupport", vfs);

        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycleGetParameter("checkbox", "foo");

        ValidatorException exception = new ValidatorException("failed");
       
        try
        {
          vfs.validate(cb, writer, cycle, "foo");
            expectLastCall().andThrow(exception);
View Full Code Here


        delegate.recordFieldInputValue(text);

        expect(field.getTranslator()).andReturn(translator);
       
        ValidatorException expected = new ValidatorException("Failure");

        //ValidationMessages messages = new ValidationMessagesImpl(field, Locale.ENGLISH);
       
        expect(translator.parse(isA(TranslatedField.class),
                isA(ValidationMessages.class), isA(String.class))).andThrow(expected);
View Full Code Here

        {
            return format.parseObject(text);
        }
        catch (ParseException ex)
        {
            throw new ValidatorException(buildMessage(messages, field, getMessageKey()),
                    getConstraint());
        }
    }
View Full Code Here

            throws ValidatorException
    {
        Number value = (Number) object;

        if (value.doubleValue() > _max)
            throw new ValidatorException(buildMessage(messages, field),
                    ValidationConstraint.TOO_LARGE);
    }
View Full Code Here

                || (String.class.isInstance(object) && (((String) object).length() == 0))
                || (Collection.class.isInstance(object) && ((Collection) object).isEmpty())
                || (UploadPart.class.isInstance(object) && ((UploadPart) object).getSize() < 1))
        {
            String message = buildMessage(messages, field);
            throw new ValidatorException(message, ValidationConstraint.REQUIRED);
        }
    }
View Full Code Here

            throws ValidatorException
    {
        Number value = (Number) object;

        if (_min > value.doubleValue())
            throw new ValidatorException(buildMessage(messages, field), ValidationConstraint.TOO_SMALL);
    }
View Full Code Here

        try {
           
            return new BigDecimal(text);
        }
        catch (NumberFormatException e) {
            throw new ValidatorException(buildMessage(messages, field, ValidationStrings.INVALID_NUMBER), ValidationConstraint.NUMBER_FORMAT);
        }
    }
View Full Code Here

            throws ValidatorException
    {
        String input = (String) object;

        if ( !PATTERN_COMPILED.matcher(input).matches() )
            throw new ValidatorException(buildMessage(messages, field),
                    ValidationConstraint.EMAIL_FORMAT);
    }
View Full Code Here

            throws ValidatorException
    {
        String input = object.toString();

        if (! _compiledPattern.matcher(input).matches() )
            throw new ValidatorException(buildMessage(messages, field),
                    ValidationConstraint.PATTERN_MISMATCH);
    }
View Full Code Here

        //TODO: if component is null treat _fieldName as an ognl expression
        boolean notEq = notEqual(referentValue, object);

        if (_matchType == MATCH ? notEq : !notEq)
            throw new ValidatorException(buildIdentityMessage(messages, field, referent),
                    ValidationConstraint.CONSISTENCY);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.valid.ValidatorException

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.