Package org.eweb4j.mvc.config.bean

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


    if (val == null || !Validators.REQUIRED.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.REQUIRED);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));

    val.getField().add(fcb);

    return val;
  }
View Full Code Here


    if (val == null || !Validators.FORBID.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.FORBID);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(Validators.FORBID_WORD_PARAM);
    StringBuilder sb = new StringBuilder();
    for (String s : ann.words()){
      if (sb.length() > 0)
        sb.append("#");
     
      sb.append(StringUtil.parsePropValue(s));
    }
   
    pcb.setValue(sb.toString());
    fcb.getParam().add(pcb);

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

    if (val == null || !Validators.IP.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.IP);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

    if (val == null || !Validators.ENUM.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.ENUM);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(Validators.ENUM_WORD_PARAM);
    StringBuilder sb = new StringBuilder();
    for (String s : ann.words()){
      if (sb.length() > 0)
        sb.append("#");
     
      sb.append(StringUtil.parsePropValue(s));
    }
   
    pcb.setValue(sb.toString());
    fcb.getParam().add(pcb);

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

      val = new ValidatorConfigBean();
      val.setName(valName);
      val.setClazz(clazz.getName());
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));
    String[] params = ann.params();
    String[] values = ann.values();
    if (params.length > 0 && values.length > 0 && params.length == values.length){
      for (int i = 0; i < params.length; i++){
        ParamConfigBean pcb = new ParamConfigBean();
        pcb.setName(StringUtil.parsePropValue(params[i]));
        pcb.setValue(StringUtil.parsePropValue(values[i]));
        fcb.getParam().add(pcb);
      }
    }
   
    val.getField().add(fcb);
View Full Code Here

    if (val == null || !Validators.EMAIL.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.EMAIL);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

    if (val == null || !Validators.ZIP.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.ZIP);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

    if (val == null || !Validators.ID_CARD.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.ID_CARD);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

    if (val == null || !Validators.INT.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.INT);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

    if (val == null || !Validators.PHONE.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(Validators.PHONE);
    }

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

TOP

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

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.