Package org.eweb4j.mvc.config.bean

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


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

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

    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(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(params[i]);
        pcb.setValue(values[i]);
        fcb.getParam().add(pcb);
      }
    }
   

    val.getField().add(fcb);
View Full Code Here

      String[] fname = fnamelist.toArray(new String[] {});

      List<FieldConfigBean> fList = new ArrayList<FieldConfigBean>();
      for (int b = 0; b < valIndex.length; ++b) {
        if (valIndex[b] == a) {
          FieldConfigBean f = new FieldConfigBean();
          fList.add(f);
          f.setName(StringUtil.parsePropValue(fname[b]));
          f.setMessage(StringUtil.parsePropValue(mess[b]));

          if (paramAnn == null || paramName == null)
            continue;

          int[] pindex = paramAnn.valMess();
          int[] pnameIndex = paramAnn.name();
          String[] pnames = paramName.value();

          List<String> pnamelist = new ArrayList<String>();
          for (int in : pnameIndex)
            pnamelist.add(StringUtil.parsePropValue(pnames[in]));

          String[] pname = pnamelist.toArray(new String[] {});
          String[] pvalue = paramAnn.value();

          List<ParamConfigBean> pList = new ArrayList<ParamConfigBean>();
          for (int c = 0; c < pindex.length; ++c) {
            if (pindex[c] == b) {
              ParamConfigBean p = new ParamConfigBean();
              p.setName(StringUtil.parsePropValue(pname[c]));
              p.setValue(StringUtil.parsePropValue(pvalue[c]));
              pList.add(p);
            }
          }

          f.setParam(pList);

        }
      }

      v.setField(fList);
View Full Code Here

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

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

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

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

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

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

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

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

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

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

    val.getField().add(fcb);

    return val;
  }
View Full Code Here

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

    FieldConfigBean fcb = new FieldConfigBean();
    fcb.setName(fieldName);
    fcb.setMessage(ann.mess());
   
    ParamConfigBean pcb = new ParamConfigBean();
    pcb.setName(ValidatorConstant.MIN_SIZE_PARAM);
    pcb.setValue(String.valueOf(ann.min()));
   
    fcb.getParam().add(pcb);
   
    ParamConfigBean pcb2 = new ParamConfigBean();
    pcb2.setName(ValidatorConstant.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 || !ValidatorConstant.STRING_LENGTH_VAL.equals(val.getName())) {
      val = new ValidatorConfigBean();
      val.setName(ValidatorConstant.STRING_LENGTH_VAL);
    }

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

    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.