public ManagePassword(Usuario usuario, ApplicationView view) { setUsuario(usuario); this.validatorSenha = ValidatorFactory.newStrRangeLen(32, 3, true); this.validatorNovaSenha = ValidatorFactory.newStrRangeLen(32, 3, true); this.validatorNovaSenhaConfirma = ValidatorFactory.newStrRangeLen(32, 3, true); this.view = view; }
protected boolean evaluateValidators(List<ValidationRequest> validations) throws Exception { boolean returned = true; for (ValidationRequest validation : validations) { Validator validador = validation.getValidator(); if (validation.getPath() != null && !validation.getPath().isEmpty()) { validador.setValue( BeanProperty.instance().getNestedProperty(getBackBean(), validation.getPath())); } if (!validador.isValid() && ValidatorFactory.checkInvalidPermiteds(validation.getInvalidPermiteds(), validador)) { for (String out : validation.getOut()) { getView().addLocalDynamicMenssage("* " + validador.getErrorMessage(), out, false); } returned = false; } } return returned; }
private void buildCodigoFilter() { Validator validator = ValidatorFactory.newNumMax(Integer.MAX_VALUE); getFiltersMap().put("idFilter", buildBasicFilter("idFilter", "Código", validator)); }
private void buildEmailFilter() { Validator validator = ValidatorFactory.newEmail(); getFiltersMap().put("emailFilter", buildBasicFilter("emailFilter", "E-mail", validator)); }
private void buildCpfFilter() { Validator validator = ValidatorFactory.newCpf(); InputMask mask = getMasksMap().get("cpf"); getFiltersMap().put("cpfFilter", buildBasicFilter("cpfFilter", "CPF", mask, validator)); }
private void buildNameFilter() { Validator validator = ValidatorFactory.newStrRangeLen(100, 3, true); getFiltersMap().put("nomeFilter", buildBasicFilter("nomeFilter", "Nome", validator)); }