Examples of RegexValidator


Examples of org.apache.sling.validation.impl.validators.RegexValidator

        }
    }

    @Test(expected=SlingValidationException.class)
    public void testValueMapWithWrongDataType() throws Exception {
        when(validatorLookupService.getValidator("org.apache.sling.validation.impl.validators.RegexValidator")).thenReturn(new
                RegexValidator());
        Whitebox.setInternalState(validationService, "validatorLookupService", validatorLookupService);

        List<TestProperty> properties = new ArrayList<TestProperty>();
        TestProperty property = new TestProperty();
View Full Code Here

Examples of org.apache.sling.validation.impl.validators.RegexValidator

        }
    }

    @Test
    public void testValueMapWithCorrectDataType() throws Exception {
        when(validatorLookupService.getValidator("org.apache.sling.validation.impl.validators.RegexValidator")).thenReturn(new
                RegexValidator());
        Whitebox.setInternalState(validationService, "validatorLookupService", validatorLookupService);

        List<TestProperty> fields = new ArrayList<TestProperty>();
        TestProperty field = new TestProperty();
View Full Code Here

Examples of org.apache.sling.validation.impl.validators.RegexValidator

        }
    }

    @Test
     public void testResourceWithMissingChildProperty() throws Exception {
        when(validatorLookupService.getValidator("org.apache.sling.validation.impl.validators.RegexValidator")).thenReturn(new
                RegexValidator());
        Whitebox.setInternalState(validationService, "validatorLookupService", validatorLookupService);

        List<TestProperty> fields = new ArrayList<TestProperty>();
        TestProperty property = new TestProperty();
View Full Code Here

Examples of org.crank.validation.validators.RegexValidator

    }
    };

    @BeforeMethod
    public void setUp() {
        validator = new RegexValidator();
        validator.setMatch("");
        validator.setResourceBundleLocator(resourceBundleLocator);
        validator.setDetailMessage("validator.regex.detail");
        validator.setSummaryMessage("validator.regex.summary");
    }
View Full Code Here

Examples of org.grails.validation.routines.RegexValidator

    /* (non-Javadoc)
     * @see org.grails.validation.ConstrainedProperty.AbstractConstraint#setParameter(java.lang.Object)
     */
    @Override
    public void setParameter(Object constraintParameter) {
        RegexValidator domainValidator = null;

        if (constraintParameter instanceof Boolean) {
            url = (Boolean)constraintParameter;
        }
        else if (constraintParameter instanceof String) {
            url = true;
            domainValidator = new RegexValidator((String) constraintParameter);
        }
        else if (constraintParameter instanceof List<?>) {
            url = true;
            List<?> regexpList = (List<?>) constraintParameter;
            domainValidator = new RegexValidator(regexpList.toArray(new String[regexpList.size()]));
        }
        else {
            throw new IllegalArgumentException("Parameter for constraint [" + ConstrainedProperty.URL_CONSTRAINT +
                    "] of property [" + constraintPropertyName + "] of class [" +
                    constraintOwningClass + "] must be a boolean, string, or list value");
View Full Code Here

Examples of org.openfaces.validator.RegexValidator

            LengthClientValidator lengthClientValidator = new LengthClientValidator();
            lengthClientValidator.setLengthValidator(lengthValidator);
            return lengthClientValidator;
        } else if (annotationClass.equals(Pattern.class)) {
            Pattern pattern = (Pattern) annotation;
            RegexValidator regexValidator = new RegexValidator();
            regexValidator.setPattern(pattern.regex());
            return regexValidator;
        } else if (annotationClass.equals(Range.class)) {
            Range range = (Range) annotation;
            LongRangeValidator longRangeValidator = new LongRangeValidator();
            longRangeValidator.setMaximum(range.max());
View Full Code Here

Examples of org.pirkaengine.form.validator.RegexValidator

        target.apply("html", formMessage, new RegexImpl(".*\\.html"));
        assertThat(target.name, is("html"));
        assertThat(target.label, is("html"));
        assertThat(target.isRequired(), is(false));
        assertThat(target.validators.size(), is(1));
        assertThat(target.validators.get(0), is((Validator<String>) new RegexValidator(".*\\.html")));
    }
View Full Code Here

Examples of org.pirkaengine.form.validator.RegexValidator

        target.apply("html", formMessage, new RegexImpl(".*\\.html", "custom_key"));
        assertThat(target.name, is("html"));
        assertThat(target.label, is("html"));
        assertThat(target.isRequired(), is(false));
        assertThat(target.validators.size(), is(1));
        assertThat(target.validators.get(0), is((Validator<String>) new RegexValidator(".*\\.html", "custom_key")));
    }
View Full Code Here

Examples of org.pirkaengine.form.validator.RegexValidator

        target.apply("html", formMessage, new RegexImpl1(".*\\.html"));
        assertThat(target.name, is("html"));
        assertThat(target.label, is("html"));
        assertThat(target.isRequired(), is(false));
        assertThat(target.validators.size(), is(1));
        assertThat(target.validators.get(0), is((Validator<String>) new RegexValidator(".*\\.html")));
    }
View Full Code Here

Examples of org.pirkaengine.form.validator.RegexValidator

        target.apply("html", formMessage, new RegexImpl1(".*\\.html", "custom_key"));
        assertThat(target.name, is("html"));
        assertThat(target.label, is("html"));
        assertThat(target.isRequired(), is(false));
        assertThat(target.validators.size(), is(1));
        assertThat(target.validators.get(0), is((Validator<String>) new RegexValidator(".*\\.html", "custom_key")));
    }
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.