Package org.eweb4j.mvc.config.bean

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


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

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));
   
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(Validators.MIN_SIZE_PARAM);
    pcb.setValue(String.valueOf(ann.min()));
   
    fcb.getParam().add(pcb);
   
    ParamConfigBean pcb2 = new ParamConfigBean();
    pcb2.setName(Validators.MAX_SIZE_PARAM);
    pcb2.setValue(String.valueOf(ann.max()));
   
    fcb.getParam().add(pcb2);

    val.getField().add(fcb);

    return val;
  }
View Full Code Here


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

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));
   
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(Validators.MIN_LENGTH_PARAM);
    pcb.setValue(String.valueOf(ann.min()));
   
    fcb.getParam().add(pcb);
   
    ParamConfigBean pcb2 = new ParamConfigBean();
    pcb2.setName(Validators.MAX_LENGTH_PARAM);
    pcb2.setValue(String.valueOf(ann.max()));
   
    fcb.getParam().add(pcb2);

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(Validators.REGEX_PARAM);
    pcb.setValue(StringUtil.parsePropValue(ann.pattern()));
    fcb.getParam().add(pcb);

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(StringUtil.parsePropValue(ann.mess()));
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(Validators.EQUALS_TO_PARAM);
   
    String value = StringUtil.parsePropValue(ann.to());
    value = fieldName.substring(0, fieldName.lastIndexOf(".")+1) + value;
    pcb.setValue(value);
   
    fcb.getParam().add(pcb);

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

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

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

    mvcBean.setResult(rlist);
   
    List<ValidatorConfigBean> vlist = new ArrayList<ValidatorConfigBean>();
    ValidatorConfigBean validator = new ValidatorConfigBean();
    List<FieldConfigBean> fieldList = new ArrayList<FieldConfigBean>();
    FieldConfigBean field = new FieldConfigBean();
    List<ParamConfigBean> paramList = new ArrayList<ParamConfigBean>();
    ParamConfigBean param = new ParamConfigBean();
    paramList.add(param);
    field.setParam(paramList);
    fieldList.add(field);
    validator.setField(fieldList);
   
   
   
View Full Code Here

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

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(ann.mess());
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(ValidatorConstant.REGEX_PARAM);
    pcb.setValue(ann.pattern());
    fcb.getParam().add(pcb);

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

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

    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.