示例#1
0
  private void addZoneCriteria(Criteria cr, FormItem fi, String fieldName) {
    Long criteria = null;
    try {
      criteria = Long.parseLong(fi.getValue().toString());
    } catch (Exception e) {

    }
    if (criteria != null) cr.addCriteria(fieldName, criteria.toString());
  }
 private void addCriteria(
     ArrayList<String> criterias, FormItem formitem, String formatedString, String notvalue) {
   Object obj = formitem.getValue();
   if (obj == null) return;
   String value = obj.toString().trim();
   if (value.length() == 0) return;
   if (value.equals(notvalue)) return;
   value = formatedString.replaceAll("%s", value);
   criterias.add(value);
 }
示例#3
0
 protected int getItemValue(FormItem item) {
   int val = 0;
   try {
     val = Integer.parseInt(item.getValue().toString());
   } catch (Exception e) {
     // TODO: handle exception
   }
   if (val < 0) val = 0;
   return val;
 }