KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > kirkk > analyzer > Configuration


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 JavaDoc packageFilters = filters.getString("filter.packages");
14         ignorePackages = new ArrayList();
15         StringTokenizer packageTokenizer = new StringTokenizer(packageFilters, ";");
16         while (packageTokenizer.hasMoreTokens()) {
17             String JavaDoc token = packageTokenizer.nextToken();
18             //System.out.println(token.substring(0, token.length() - 1));
19
ignorePackages.add(token.substring(0, token.length() - 1));
20         }
21
22         String JavaDoc jarFilters = filters.getString("filter.jars");
23         ignoreJars = new ArrayList();
24         StringTokenizer jarTokenizer = new StringTokenizer(jarFilters, ";");
25         while (jarTokenizer.hasMoreTokens()) {
26             String JavaDoc token = jarTokenizer.nextToken();
27             ignoreJars.add(token.substring(0, token.length()));
28         }
29     }
30
31     public static void initialize(String JavaDoc packageFilter, String JavaDoc jarFilter) {
32         if (packageFilter != null) {
33             ignorePackages = new ArrayList();
34             StringTokenizer packageTokenizer = new StringTokenizer(packageFilter, ";");
35             while (packageTokenizer.hasMoreTokens()) {
36                 String JavaDoc token = packageTokenizer.nextToken();
37                 //System.out.println(token.substring(0, token.length() - 1));
38
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 JavaDoc token = jarTokenizer.nextToken();
47                 ignoreJars.add(token.substring(0, token.length()));
48             }
49         }
50     }
51
52 }
Popular Tags