Package org.crank.validation

Examples of org.crank.validation.ValidatorMessages


    }

    @Test()
  public void testCompositePass() {

        ValidatorMessages messages = (ValidatorMessages) validator.validate("crap", "fieldLabel");
        assertNotNull(messages);

        for (ValidatorMessage message : messages) {
            assertNotNull(message);
            assertFalse(message.hasError());
View Full Code Here


        validatorList.add( onRuleValidator );
        validatorList.add( fail );
        validatorList.add( fail );
        validator.setValidatorList(validatorList);
       
        ValidatorMessages messages = (ValidatorMessages) validator.validate("crap", "fieldLabel");
        assertNotNull(messages);

        assertEquals( 1, count );
    }
View Full Code Here

        validatorList.add( onRuleValidator );
        validatorList.add( fail );
        validatorList.add( fail );
        validator.setValidatorList(validatorList);
       
        ValidatorMessages messages = (ValidatorMessages) validator.validate("crap", "fieldLabel");
        assertNotNull(messages);

        assertEquals( 1, count );
    }
View Full Code Here

        validatorList.add( onRuleValidator );
        validatorList.add( fail );
        validatorList.add( fail );
        validator.setValidatorList(validatorList);
       
        ValidatorMessages messages = (ValidatorMessages) validator.validate("crap", "fieldLabel");
        assertNotNull(messages);

        assertEquals( 1, count );
    }
View Full Code Here

        validatorList.add( onRuleValidator );
        validatorList.add( fail );
        validatorList.add( fail );
        validator.setValidatorList(validatorList);
       
        ValidatorMessages messages = (ValidatorMessages) validator.validate("", "fieldLabel");
        assertNotNull(messages);

        assertEquals( 0, count );
    }
View Full Code Here

        validatorList.add( onRuleValidator );
        validatorList.add( fail );
        validatorList.add( fail );
        validator.setValidatorList(validatorList);
       
        ValidatorMessages messages = (ValidatorMessages) validator.validate(null, "fieldLabel");
        assertNotNull(messages);

        assertEquals( 0, count );
    }
View Full Code Here

        validatorList.add( fail );
        validatorList.add( fail );
        validator.setValidatorList(validatorList);
        validator.setStopOnBlank( false );
       
        ValidatorMessages messages = (ValidatorMessages) validator.validate(null, "fieldLabel");
        assertNotNull(messages);

        assertEquals( 1, count );
    }
View Full Code Here

        }
    }

    public ValidatorMessageHolder validate(Object object, String fieldLabel) {
       
        ValidatorMessages messages = new ValidatorMessages(); //holds error messages.
       
        /* Validate with the requiredValidator if it is present. */
        ValidatorMessage requiredMessage = validateWithRequriedIfPresent( object, fieldLabel, messages );

        boolean proceed = !(stopOnBlank && (object == null || object.toString().trim().length() == 0));
View Full Code Here

      if (message.hasError()) {
        throw new ValidatorException(
            convertMessageToFacesMessage(message));
      }
    } else if (imessage instanceof ValidatorMessages) {
      ValidatorMessages messages = (ValidatorMessages) imessage;
      for (ValidatorMessage message : messages) {
        if (message.hasError()) {
          facesContext.addMessage(
              component.getClientId(facesContext),
              convertMessageToFacesMessage(message));
View Full Code Here

TOP

Related Classes of org.crank.validation.ValidatorMessages

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.