Esempio n. 1
0
 public Object getFilterValue(Filter filter) {
   switch (columnType) {
     case INTEGER:
       return Integer.valueOf(filter.getValue());
     case STRING:
       return filter.getValue();
     case DATE:
       return DateUtil.convert(filter.getValue());
     default:
       return null; // will not happen
   }
 }
  public Criteria execute(Criteria criteria) {
    for (Filter filter : filters) {
      buildCriteria(criteria, filter.getProperty(), filter.getValue());
    }

    return criteria;
  }
 public String execute(String criteria) {
   String theCriteria = "";
   for (Filter filter : filters) {
     theCriteria += buildCriteria(criteria, filter.getProperty(), filter.getValue());
   }
   return theCriteria;
 }
Esempio n. 4
0
 /**
  * Gets the filter hash of the FilterSet.
  *
  * @return The hash of the tokens and values for quick lookup.
  */
 public synchronized Hashtable getFilterHash() {
   if (filterHash == null) {
     filterHash = new Hashtable(getFilters().size());
     for (Enumeration e = getFilters().elements(); e.hasMoreElements(); ) {
       Filter filter = (Filter) e.nextElement();
       filterHash.put(filter.getToken(), filter.getValue());
     }
   }
   return filterHash;
 }
Esempio n. 5
0
 static {
   for (Filter s : EnumSet.allOf(Filter.class)) lookup.put(s.getValue(), s);
 }