/[classpath]/gjdoc/src/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by julian, Mon Dec 13 19:05:30 2004 UTC revision 1.2 by julian, Mon Dec 13 19:14:39 2004 UTC
# Line 24  import java.util.LinkedHashSet; Line 24  import java.util.LinkedHashSet;
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
# Line 49  public class DocletOptionPackageWildcard Line 50  public class DocletOptionPackageWildcard
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();

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26