Package javax.faces.application

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


  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

  @Override
  protected Validator createValidator() throws JspException
  {
    String validatorId = DateTimeRangeValidator.VALIDATOR_ID;
    Application appl = FacesContext.getCurrentInstance().getApplication();
    DateTimeRangeValidator validator = (DateTimeRangeValidator)appl.createValidator(validatorId);
    _setProperties(validator);
    return validator;
  }

  private void _setProperties(
View Full Code Here

  @Override
  protected Validator createValidator() throws JspException
  {
    String validatorId = RegExpValidator.VALIDATOR_ID;
    Application appl = FacesContext.getCurrentInstance().getApplication();
    RegExpValidator validator = (RegExpValidator)appl.createValidator(validatorId);
    _setProperties(validator);
    return validator;
  }

  private void _setProperties(
View Full Code Here

  @Override
  protected Validator createValidator() throws JspException
  {
    String validatorId = ByteLengthValidator.VALIDATOR_ID;
    Application appl = FacesContext.getCurrentInstance().getApplication();
    ByteLengthValidator validator = (ByteLengthValidator)appl.createValidator(validatorId);
    _setProperties(validator);
    return validator;
  }

  private void _setProperties(
View Full Code Here

  @Override
  protected Validator createValidator() throws JspException
  {
    String validatorId = LongRangeValidator.VALIDATOR_ID;
    Application appl = FacesContext.getCurrentInstance().getApplication();
    LongRangeValidator validator = (LongRangeValidator)appl.createValidator(validatorId);
    _setProperties(validator);
    return validator;
  }

  private void _setProperties(
View Full Code Here

  @Override
  protected Validator createValidator() throws JspException
  {
    String validatorId = DateRestrictionValidator.VALIDATOR_ID;
    Application appl = FacesContext.getCurrentInstance().getApplication();
    DateRestrictionValidator validator = (DateRestrictionValidator)appl.createValidator(validatorId);
    _setProperties(validator);
    return validator;
  }

  private void _setProperties(
View Full Code Here

  @Override
  protected Validator createValidator() throws JspException
  {
    String validatorId = DoubleRangeValidator.VALIDATOR_ID;
    Application appl = FacesContext.getCurrentInstance().getApplication();
    DoubleRangeValidator validator = (DoubleRangeValidator)appl.createValidator(validatorId);
    _setProperties(validator);
    return validator;
  }

  private void _setProperties(
View Full Code Here

  @Override
  protected Validator createValidator() throws JspException
  {
    String validatorId = LengthValidator.VALIDATOR_ID;
    Application appl = FacesContext.getCurrentInstance().getApplication();
    LengthValidator validator = (LengthValidator)appl.createValidator(validatorId);
    _setProperties(validator);
    return validator;
  }

  private void _setProperties(
View Full Code Here

        try
        {
            // first check if an ValidatorId was set by a method
            if (null != _validatorIdString)
            {
                validator = application.createValidator(_validatorIdString);
            } else if (null != _validatorId)
            {
                String validatorId = (String) _validatorId.getValue(elContext);
                validator = application.createValidator(validatorId);
            }
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.