Example #1
0
 protected void acaoFormatarCampos() throws Exception {
   formatarCamposExtras();
   List<String> camposFormatados = getCamposFormatados();
   for (String path : camposFormatados) {
     Object o = BeanProperty.instance().getNestedProperty(getBackBean(), path);
     String campoParaFormatar = null;
     if (o != null) {
       campoParaFormatar = String.valueOf(o);
     } else {
       continue;
     }
     if (!campoParaFormatar.isEmpty()) {
       String atributoFormatado =
           WordFormatter.clear(WordFormatter.remover(campoParaFormatar)).toUpperCase();
       BeanProperty.instance().setNestedProperty(getBackBean(), path, atributoFormatado);
     }
   }
 }
Example #2
0
 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;
 }