1 package com.kirkk.analyzer; 2 3 import java.util.*; 4 5 public class Configuration { 6 7 public static List ignorePackages; 8 public static List ignoreJars; 9 10 static { 11 ResourceBundle filters = ResourceBundle.getBundle("com.kirkk.analyzer.framework.Filter"); 12 13 String packageFilters = filters.getString("filter.packages"); 14 ignorePackages = new ArrayList(); 15 StringTokenizer packageTokenizer = new StringTokenizer(packageFilters, ";"); 16 while (packageTokenizer.hasMoreTokens()) { 17 String token = packageTokenizer.nextToken(); 18 ignorePackages.add(token.substring(0, token.length() - 1)); 20 } 21 22 String jarFilters = filters.getString("filter.jars"); 23 ignoreJars = new ArrayList(); 24 StringTokenizer jarTokenizer = new StringTokenizer(jarFilters, ";"); 25 while (jarTokenizer.hasMoreTokens()) { 26 String token = jarTokenizer.nextToken(); 27 ignoreJars.add(token.substring(0, token.length())); 28 } 29 } 30 31 public static void initialize(String packageFilter, String jarFilter) { 32 if (packageFilter != null) { 33 ignorePackages = new ArrayList(); 34 StringTokenizer packageTokenizer = new StringTokenizer(packageFilter, ";"); 35 while (packageTokenizer.hasMoreTokens()) { 36 String token = packageTokenizer.nextToken(); 37 ignorePackages.add(token.substring(0, token.length() - 1)); 39 } 40 } 41 42 if (jarFilter != null) { 43 ignoreJars = new ArrayList(); 44 StringTokenizer jarTokenizer = new StringTokenizer(jarFilter, ";"); 45 while (jarTokenizer.hasMoreTokens()) { 46 String token = jarTokenizer.nextToken(); 47 ignoreJars.add(token.substring(0, token.length())); 48 } 49 } 50 } 51 52 } | Popular Tags |