Package javax.faces.application

Examples of javax.faces.application.Application.createValidator()


      validator = (LongRangeValidator) _bindingExpr.getValue(elContext);

    if (validator == null) {
      String id = LongRangeValidator.VALIDATOR_ID;

      validator = (LongRangeValidator) app.createValidator(id);

      if (_bindingExpr != null)
        _bindingExpr.setValue(elContext, validator);
    }
View Full Code Here


      validator = (DoubleRangeValidator) _bindingExpr.getValue(elContext);

    if (validator == null) {
      String id = DoubleRangeValidator.VALIDATOR_ID;

      validator = (DoubleRangeValidator) app.createValidator(id);

      if (_bindingExpr != null)
        _bindingExpr.setValue(elContext, validator);
    }
View Full Code Here

      validator = (LengthValidator) _bindingExpr.getValue(elContext);

    if (validator == null) {
      String id = LengthValidator.VALIDATOR_ID;

      validator = (LengthValidator) app.createValidator(id);

      if (_bindingExpr != null)
        _bindingExpr.setValue(elContext, validator);
    }
View Full Code Here

                if (validatorClassName == null)
                {
                    // we have no class name for validators of enclosing <f:validateBean> tags
                    // --> we have to create it to get the class name
                    // note that normally we can use this instance later anyway!
                    enclosingValidator = application.createValidator(validatorId);
                    validatorClassName = enclosingValidator.getClass().getName();
                }
               
                // check if the validator is already registered for the given component
                // this happens if <f:validateBean /> is nested inside the component on the view
View Full Code Here

                            validator = enclosingValidator;
                        }
                        else
                        {
                            // create it
                            validator = application.createValidator(validatorId);
                        }
                        // add the validator to the component
                        component.addValidator(validator);
                    }
                    else
View Full Code Here

        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application application = facesContext.getApplication();
        if (UIComponentTag.isValueReference(_validatorId))
        {
            ValueBinding vb = facesContext.getApplication().createValueBinding(_validatorId);
            return application.createValidator((String)vb.getValue(facesContext));
        }
        else
        {
            return application.createValidator(_validatorId);
        }
View Full Code Here

            ValueBinding vb = facesContext.getApplication().createValueBinding(_validatorId);
            return application.createValidator((String)vb.getValue(facesContext));
        }
        else
        {
            return application.createValidator(_validatorId);
        }
    }
}
View Full Code Here

  protected Validator createValidator() throws JspException {
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final Application application = facesContext.getApplication();
    final SubmittedValueLengthValidator validator
        = (SubmittedValueLengthValidator) application.createValidator(SubmittedValueLengthValidator.VALIDATOR_ID);
    final ELContext elContext = FacesContext.getCurrentInstance().getELContext();

    if (minimum != null) {
      try {
        validator.setMinimum((Integer) minimum.getValue(elContext));
View Full Code Here

  protected Validator createValidator() throws JspException {

    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final Application application = facesContext.getApplication();
    final FileItemValidator validator = (FileItemValidator) application.createValidator(FileItemValidator.VALIDATOR_ID);
    final ELContext elContext = facesContext.getELContext();

    if (maxSize != null) {
      try {
        validator.setMaxSize((Integer) maxSize.getValue(elContext));
View Full Code Here

        }

        // we now have the complete List of Validator IDs to add to the
        // target EditablValueHolder
        for (String id : validatorIds) {
            Validator v = application.createValidator(id);
            // work backwards up the stack of ValidatorInfo to find the
            // nearest matching ValidatorInfo to apply attributes
            if (validatorStack != null) {
                for (int i = validatorStack.size() - 1; i >= 0; i--) {
                    ValidatorInfo info = validatorStack.get(i);
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.