Package javax.faces.validator

Examples of javax.faces.validator.ValidatorException


    Object[] args = {value.toString(),(foreignEditableValueHolder.getValue()==null) ? foreignComp.getId():foreignEditableValueHolder.getValue().toString()};

    if(foreignEditableValueHolder.getValue()==null || !foreignEditableValueHolder.getValue().toString().equals(value.toString())  )
        {
            throw new ValidatorException(getFacesMessage(EQUAL_MESSAGE_ID, args));
        }

  }
View Full Code Here


    matcher = pattern.matcher(componentValue);

    if (!matcher.find()) {
      String msg = MessageFormat.format("{0} not a valid isbn format", componentValue);
      FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
      throw new ValidatorException(facesMessage);
    }
  }
View Full Code Here

         }
         catch (ELException ele)
         {
            Throwable cause = ele.getCause();
            if (cause==null) cause = ele;
            throw new ValidatorException( createMessage(cause), cause );
         }
        
         if ( invalidValues.length>0 )
         {
            throw new ValidatorException( createMessage(invalidValues) );
         }
      }
   }
View Full Code Here

   }

   private void addRequiredMessage(FacesContext facesContext)
   {
      ResourceBundle resourceBundle = SeamResourceBundle.getBundle();
      throw new ValidatorException( new FacesMessage(
               FacesMessage.SEVERITY_ERROR,
               resourceBundle.getString("javax.faces.component.UIInput.REQUIRED"),
               null
            ) );
   }
View Full Code Here

    @Override
    public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
        if (value != null) {
            if (!Jsoup.isValid(value.toString(), whitelist)) {
                FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN, "message contains unsafe character sequence", "");
                throw new ValidatorException(message);
            }
        }
    }
View Full Code Here

        List<EntityBean> beans = (List) value;
        for (EntityBean bean : beans) {
            Integer integer = Integer.parseInt(bean.getValue());
            if (integer % 2 != 0) {
                FacesMessage msg = new FacesMessage("Only even values allowed");
                throw new ValidatorException(msg);
            }
        }
    }
View Full Code Here

          + " "+errorMSG);
    } else {
      message.setDetail(id+" "+errorMSG);
    }
//    fc.addMessage("registration:"+id, message);
    throw new ValidatorException(message);
  }
View Full Code Here

    public void validateCar(FacesContext context, UIComponent component, Object value) throws ValidatorException
    {
        if (value instanceof String && value.equals("c6"))
        {
            throw new ValidatorException(new FacesMessage("Are you kidding?", "You cannot buy a James Blond car!"));
        }
    }
View Full Code Here

        return;
      }
    initValidator();
    if (!this.creditCardValidator.isValid(value.toString())){
      Object[] args = {value.toString()};
      throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR,CREDITCARD_MESSAGE_ID, args));
    }
  }
View Full Code Here

      {
        return;
      }
      if (!isbnValidator.isValid( value.toString())) {
        Object[] args = {value.toString()};
        throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR,ISBN_MESSAGE_ID, args));
       
      }

  }
View Full Code Here

TOP

Related Classes of javax.faces.validator.ValidatorException

Copyright © 2018 www.massapicom. 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.