Examples of MaxLengthValidator


Examples of com.sencha.gxt.widget.core.client.form.validator.MaxLengthValidator

//              });

          final TextField fieldInput = new TextField();
          fieldInput.setValue("first");
          fieldInput.setAllowBlank(false);
          fieldInput.addValidator(new MaxLengthValidator(20));
          final RegExp regex = RegExp.compile("\\s");
          fieldInput.addValidator(new Validator<String>() {
            public List<EditorError> validate(Editor<String> editor, String value) {
              if (regex.test(value)) {
                List<EditorError> errors = new ArrayList<EditorError>();
View Full Code Here

Examples of org.camunda.bpm.engine.impl.form.validator.MaxLengthValidator

    assertTrue(validator.validate(4.1f, new TestValidatorContext("4.2")));

  }

  public void testMaxLengthValidator() {
    MaxLengthValidator validator = new MaxLengthValidator();

    assertTrue(validator.validate(null, null));

    assertTrue(validator.validate("test", new TestValidatorContext("5")));
    assertFalse(validator.validate("test", new TestValidatorContext("4")));

    try {
      validator.validate("test", new TestValidatorContext("4.4"));
      fail("exception expected");
    } catch (ProcessEngineException e) {
      assertTrue(e.getMessage().contains("Cannot validate \"maxlength\": configuration 4.4 cannot be interpreted as Integer"));
    }
  }
View Full Code Here

Examples of org.mod4j.runtime.validation.MaxLengthValidator

    validation.addValidator(new NotNullValidator(Customer.class,
        "customerNr"));

    validation.addValidator(new MinLengthValidator(Customer.class,
        "username", USERNAME_MINLENGTH));
    validation.addValidator(new MaxLengthValidator(Customer.class,
        "username", USERNAME_MAXLENGTH));

    validation.addValidator(new RegExpValidator(Customer.class,
        "emailAddress", EMAILADDRESS_REGEXP));
View Full Code Here

Examples of org.mod4j.runtime.validation.MaxLengthValidator

  public static final Integer NAME_MAXLENGTH = 50;

  private void addValidators() {

    validation.addValidator(new NotNullValidator(Superclass.class, "name"));
    validation.addValidator(new MaxLengthValidator(Superclass.class,
        "name", NAME_MAXLENGTH));

  }
View Full Code Here

Examples of org.mod4j.runtime.validation.MaxLengthValidator

  private void addValidators() {

    validation
        .addValidator(new NotNullValidator(Artist.class, "artistName"));

    validation.addValidator(new MaxLengthValidator(Artist.class,
        "biography", BIOGRAPHY_MAXLENGTH));

  }
View Full Code Here

Examples of org.strecks.validator.MaxLengthValidator

    try
    {
      BadlyTypedValidatorForm bean = new BadlyTypedValidatorForm();

      Method method = bean.getClass().getMethod("getRequiredInteger");
      MaxLengthValidator validator = new MaxLengthValidator();

      ValidationAnnotationReader reader = new ValidationAnnotationReader();
      reader.checkValidatorType("propertyName", method, validator.getClass(), Validator.class,
          ValidateInteger.class);

      Assert.fail("Should have caught " + ApplicationConfigurationException.class);

    }
View Full Code Here

Examples of org.strecks.validator.MaxLengthValidator

{

  public ValidatorWrapper create(Annotation annot, Method method)
  {
    ValidateMaxLength annotation = (ValidateMaxLength) annot;
    MaxLengthValidator validator = new MaxLengthValidator();
    validator.setLength(annotation.maxLength());

    List<Object> parameters = new ArrayList<Object>();
    parameters.add(annotation.maxLength());

    return create(validator, annotation.key(), annotation.order(), parameters, method);
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.