public static Filter<?> convert(String expression,boolean allow){
  if (!isPattern(expression)) {
    if (allow) {
      ClassFilter filter=new ClassFilter(expression);
      return filter;
    }
    NegateClassFilter filter=new NegateClassFilter(expression);
    return filter;
  }
  if (isPackagePattern(expression) && !isRegexPattern(expression)) {
    String packageName=expression.substring(0,expression.length() - 2);
    if (allow) {
      PackageFilter filter=new PackageFilter(packageName);
      return filter;
    }
    NegatePackageFilter filter=new NegatePackageFilter(packageName);
    return filter;
  }
  return convertToRegex(expression,allow);
}

public static Filter < ? > convert ( String expression , boolean allow ) { if ( ! isPattern ( expression ) ) { if ( allow ) { ClassFilter filter = new ClassFilter ( expression ) ; return filter ; } NegateClassFilter filter = new NegateClassFilter ( expression ) ; return filter ; } if ( isPackagePattern ( expression ) && ! isRegexPattern ( expression ) ) { String packageName = expression . substring ( 0 , expression . length ( ) - 2 ) ; if ( allow ) { PackageFilter filter = new PackageFilter ( packageName ) ; return filter ; } NegatePackageFilter filter = new NegatePackageFilter ( packageName ) ; return filter ; } return convertToRegex ( expression , allow ) ; }
convert the wildcard expression into a filter .
