24 |
import java.util.Set; |
import java.util.Set; |
25 |
import java.util.SortedSet; |
import java.util.SortedSet; |
26 |
import java.util.StringTokenizer; |
import java.util.StringTokenizer; |
27 |
|
import java.util.TreeSet; |
28 |
|
|
29 |
/** |
/** |
30 |
* Processes a doclet option whose value consists of a |
* Processes a doclet option whose value consists of a |
50 |
|
|
51 |
public boolean set(String[] optionArr) |
public boolean set(String[] optionArr) |
52 |
{ |
{ |
53 |
if (allowAll && "all".equals(optionArr[2])) { |
try { |
54 |
packageMatcher = null; |
if (allowAll && "all".equals(optionArr[2])) { |
55 |
} |
packageMatcher = null; |
|
else { |
|
|
packageMatcher = new PackageMatcher(); |
|
|
|
|
|
StringTokenizer tokenizer = new StringTokenizer(optionArr[2], ":"); |
|
|
while (tokenizer.hasMoreTokens()) { |
|
|
String packageWildcard = tokenizer.nextToken(); |
|
|
packageMatcher.addWildcard(packageWildcard); |
|
56 |
} |
} |
57 |
|
else { |
58 |
|
packageMatcher = new PackageMatcher(); |
59 |
|
|
60 |
|
StringTokenizer tokenizer = new StringTokenizer(optionArr[2], ":"); |
61 |
|
while (tokenizer.hasMoreTokens()) { |
62 |
|
String packageWildcard = tokenizer.nextToken(); |
63 |
|
packageMatcher.addWildcard(packageWildcard); |
64 |
|
} |
65 |
|
} |
66 |
|
return true; |
67 |
|
} |
68 |
|
catch (InvalidPackageWildcardException e) { |
69 |
|
// FIXME: output problem description here, better throw |
70 |
|
// DocletConfigurationException |
71 |
|
return false; |
72 |
} |
} |
|
return true; |
|
73 |
} |
} |
74 |
|
|
75 |
// FIXME: should be renamed to filter() |
public SortedSet filter(PackageDoc[] packages) |
|
public SortedSet match(PackageDoc[] packages) |
|
76 |
{ |
{ |
77 |
if (null != packageMatcher) { |
if (null != packageMatcher) { |
78 |
return packageMatcher.match(packages); |
return packageMatcher.filter(packages); |
79 |
} |
} |
80 |
else { |
else { |
81 |
SortedSet result = new TreeSet(); |
SortedSet result = new TreeSet(); |