Package org.eweb4j.mvc.config.bean

Examples of org.eweb4j.mvc.config.bean.ValidatorConfigBean


  public ValidatorConfigBean create(String fieldName, ValidatorConfigBean val) {
    if (this.ann == null)
      return null;
    if (val == null || !Validators.URL.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.URL);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
View Full Code Here


  public ValidatorConfigBean create(String fieldName, ValidatorConfigBean val) {
    if (this.ann == null)
      return null;
    if (val == null || !ValidatorConstant.REGEX_VAL.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(ValidatorConstant.REGEX_VAL);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
View Full Code Here

  public ValidatorConfigBean create(String fieldName, ValidatorConfigBean val) {
    if (this.ann == null)
      return null;
    if (val == null || !ValidatorConstant.ENUM_VAL.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(ValidatorConstant.ENUM_VAL);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
View Full Code Here

    if (valList == null || valList.isEmpty())
      return validation;

    // 启动验证器
    for (int i = valList.size() - 1; i > -1; i--) {
      ValidatorConfigBean val = valList.get(i);
      ValidatorIF validator = null;
      if (!"".equals(val.getName())) {
        // 根据name属性实例化相关的验证器,如果找不到,就根据class属性实例化
        validator = ValidatorFactory.getValidator(val.getName());
        if (validator == null)
          try {
            validator = (ValidatorIF) Class.forName(val.getClazz()).newInstance();
          } catch (Exception e) {
            log.error(StringUtil.getExceptionString(e));
          }
      }
View Full Code Here

TOP

Related Classes of org.eweb4j.mvc.config.bean.ValidatorConfigBean

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.