Examples of RegexValidator


Examples of com.sun.faces.ext.validator.RegexValidator

    @Override
    protected Validator createValidator() {
       
        Application app = FacesContext.getCurrentInstance().getApplication();
        RegexValidator validator =
                (RegexValidator) app.createValidator("com.sun.faces.ext.validator.RegexValidator");
        validator.setPattern(regex);
        return validator;
    }
View Full Code Here

Examples of com.sun.faces.ext.validator.RegexValidator

    @Override
    protected Validator createValidator() {

        FacesContext ctx = FacesContext.getCurrentInstance();
        Application app = ctx.getApplication();
        RegexValidator validator =
                (RegexValidator) app.createValidator("com.sun.faces.ext.validator.RegexValidator");
        validator.setPattern((String) regex.getValue(ctx.getELContext()));
        return validator;
       
    }
View Full Code Here

Examples of javax.faces.validator.RegexValidator

     *
     * @see org.richfaces.javascript.client.validator.ValidatorTestBase#createValidator()
     */
    @Override
    protected Validator createValidator() {
        RegexValidator validator = new RegexValidator();
        Map<String, Object> options = getOptions();
        if (options.containsKey(PATTERN)) {
            validator.setPattern((String) options.get(PATTERN));
        }
        return validator;
    }
View Full Code Here

Examples of javax.faces.validator.RegexValidator

    }

    @Override
    protected Validator createValidator() throws JspException {
        super.setValidatorId(VALIDATOR_ID_EXPR);
        RegexValidator validator = (RegexValidator) super.createValidator();
        assert (validator != null);
        if (regex != null) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            validator.setPattern((String) regex.getValue(ctx.getELContext()));
        }
        return validator;
       
    }
View Full Code Here

Examples of javax.faces.validator.RegexValidator

            }
        }
        if (null != _pattern)
        {
            Application appl = fc.getApplication();
            RegexValidator validator = (RegexValidator) appl.createValidator(RegexValidator.VALIDATOR_ID);
            String pattern = (String)_pattern.getValue(elc);
            validator.setPattern(pattern);

            if (_binding != null)
            {
                _binding.setValue(elc, validator);
            }
View Full Code Here

Examples of javax.faces.validator.RegexValidator

    }

    @Override
    protected Validator createValidator() throws JspException {
        super.setValidatorId(VALIDATOR_ID_EXPR);
        RegexValidator validator = (RegexValidator) super.createValidator();
        assert (validator != null);
        if (regex != null) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            validator.setPattern((String) regex.getValue(ctx.getELContext()));
        }
        return validator;
       
    }
View Full Code Here

Examples of javax.faces.validator.RegexValidator

    }

    @Override
    protected Validator createValidator() throws JspException {
        super.setValidatorId(VALIDATOR_ID_EXPR);
        RegexValidator validator = (RegexValidator) super.createValidator();
        assert (validator != null);
        if (regex != null) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            validator.setPattern((String) regex.getValue(ctx.getELContext()));
        }
        return validator;
       
    }
View Full Code Here

Examples of javax.faces.validator.RegexValidator

            }
            if (validator.getMinimum() != 0) {
                descriptor.addParameter(MINIMUM, validator.getMinimum());
            }
        } else if (component instanceof RegexValidator) {
            RegexValidator validator = (RegexValidator) component;
            descriptor.addParameter(PATTERN, validator.getPattern());
        } else if (component instanceof RequiredValidator) {
            // do nothing.
        } else {
            super.fillParameters(descriptor, component);
        }
View Full Code Here

Examples of javax.faces.validator.RegexValidator

    }

    @Override
    protected Validator createValidator() throws JspException {
        super.setValidatorId(VALIDATOR_ID_EXPR);
        RegexValidator validator = (RegexValidator) super.createValidator();
        assert (validator != null);
        if (regex != null) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            validator.setPattern((String) regex.getValue(ctx.getELContext()));
        }
        return validator;
       
    }
View Full Code Here

Examples of org.apache.commons.validator.routines.RegexValidator

  /*
    * Testing the same method of URL validator used in validate method. Its was really hard to create Error object
    */
@Test
public void testValidation() throws Exception {
      RegexValidator regex = new RegexValidator(new String[]{"http","https","((localhost)(:[0-9]+))",".*\\.linux-server(:[0-9]+)"});
      UrlValidator validator = new UrlValidator(regex, 0);
      assertTrue("localhost URL should validate",
                validator.isValid("http://localhost:8080/demogadgets/CTSSResourcesMapView.xml"));
        assertTrue("127.0.0.1 should validate",
                validator.isValid("http://127.0.0.1:8080/demogadgets/CTSSResourcesMapView.xml"));
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.