1 /* 2 * Jour - java profiler and monitoring library 3 * 4 * Copyright (C) 2004 Jour team 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 * Boston, MA 02111-1307, USA. 20 */ 21 package net.sf.jour.filter; 22 23 import java.util.StringTokenizer; 24 //import java.util.regex.Pattern; 25 import org.apache.regexp.RE; 26 27 import com.sun.msv.verifier.regexp.StringToken; 28 29 /*** 30 * @author michaellif TODO To change the template for this generated type 31 * comment go to Window - Preferences - Java - Code Style - Code 32 * Templates 33 */ 34 public class ClassFilter extends MatchStringListFilter { 35 36 //private String[] typedefArray; 37 //private Pattern[] patternArray; 38 //private RE[] patternArray; 39 40 public ClassFilter(String def) { 41 super(def); 42 /* 43 StringTokenizer tokenizer = new StringTokenizer(def,","); 44 typedefArray = new String[tokenizer.countTokens()]; 45 //patternArray = new Pattern[tokenizer.countTokens()]; 46 patternArray = new RE[tokenizer.countTokens()]; 47 int i = 0; 48 while (tokenizer.hasMoreTokens()) { 49 typedefArray[i] = tokenizer.nextToken().trim(); 50 patternArray[i] = getGlobPattern(typedefArray[i]); 51 i++; 52 } 53 */ 54 } 55 56 public boolean accept(String clazz) { 57 return match(clazz); 58 } 59 60 /* 61 public boolean accept(String clazz) { 62 if (typedefArray.length == 0) { 63 return true; 64 } 65 for (int i = 0; i < patternArray.length; i++) { 66 if (super.accept(patternArray[i], clazz)) { 67 return true; 68 } 69 } 70 return false; 71 }*/ 72 }