package com.onaro.util.jfc.tables.filter; import com.onaro.util.jfc.tables.filter.matcher.*; public class NumberFilterMatcherFactory extends FilterMatcherFactory{ protected FilterMatcher createConcreteMatcher(String token) throws FilterException { if (token.startsWith(NOT)) { //remove the minus String tokenWithoutMinus = token.substring(1); //remove quotes if needed if (tokenWithoutMinus.length() > 1 && tokenWithoutMinus.charAt(0) == '"' && tokenWithoutMinus.charAt(tokenWithoutMinus.length() - 1) == '"') { String tokenWithoutQuotes = tokenWithoutMinus.substring(1, tokenWithoutMinus.length() - 1); //wrap for not... return new NotFilterMatcher(new NumberFilterMatcher(tokenWithoutQuotes)); }else { //the minus belongs to the value return new NumberFilterMatcher(token); } } else { //remove quotes if needed token = stripQuotesIfNeeded(token); return new NumberFilterMatcher(token); } } }