DocCheck 1.2 Beta 2

com.sun.tools.doclets.util
Class PackageList

java.lang.Object
  |
  +--com.sun.tools.doclets.util.PackageList

public class PackageList
extends java.lang.Object

Generates a list of packages under the specified root directory(s). Writes the list to standard output when run from the command line, or returns it as a LinkedList when the findPkgs(java.io.File, java.io.File) method is invoked.

Author:
Eric Armstrong

Field Summary
static java.util.LinkedList namesToSkip
          A list of directory names to be skipped anywhere they appear in the hierarchy.
static java.util.LinkedList pkgsToSkip
          A list of fully-qualified directory paths to be skipped.
 
Constructor Summary
PackageList()
           
 
Method Summary
protected static void echoUsage()
          Delivers usage instructions when the program is invoked with no arguments.
static java.util.LinkedList findPkgs(java.io.File root, java.io.File dir)
          Recursively searches a directory and returns a list of package names corresponding to directories that (a) contain .java or .class files and (b) are not in either of the "skip lists" specified on the command line.
static void main(java.lang.String[] args)
          Recursively searches the list of directories specified on the command line and identifies Java packages.
static java.lang.String pkgName(java.io.File root, java.io.File dir)
          Return the package name corresponding to the specified directory.
protected static void processArgs(java.lang.String[] args)
          Process the command line to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namesToSkip

public static java.util.LinkedList namesToSkip
A list of directory names to be skipped anywhere they appear in the hierarchy. Use simple names and invoke "namesToSkip.add(new Specifier(name))" to add entries to this list, or use the processArgs(java.lang.String[]) method to do all the setup work.

See Also:
Specifier

pkgsToSkip

public static java.util.LinkedList pkgsToSkip
A list of fully-qualified directory paths to be skipped. Use fully qualified package names and invoke "pkgsToSkip.add(new PathSpecifier(pkg, "."))" to add entries to this list, or use the processArgs(java.lang.String[]) method to do all the setup work.

See Also:
PathSpecifier
Constructor Detail

PackageList

public PackageList()
Method Detail

main

public static void main(java.lang.String[] args)
Recursively searches the list of directories specified on the command line and identifies Java packages. For complete usage instructions, see echoUsage() or run the program with no arguments.


findPkgs

public static java.util.LinkedList findPkgs(java.io.File root,
                                            java.io.File dir)
Recursively searches a directory and returns a list of package names corresponding to directories that (a) contain .java or .class files and (b) are not in either of the "skip lists" specified on the command line. Use the processArgs(java.lang.String[]) method to specify a list of directories to process as well as lists of packages to skip, or else manually set the namesToSkip and pkgsToSkip lists before invoking this method.

Parameters:
root - The root of the package tree.
dir - The directory to search.

pkgName

public static java.lang.String pkgName(java.io.File root,
                                       java.io.File dir)
Return the package name corresponding to the specified directory. Subtracts the "root" path from the directory path and converts the directory-name separators to dots. For directory /x/y/z/foo with root /x/y, the result is z.foo

Parameters:
root - The root of the package tree.
dir - The directory to convert to a package name.

echoUsage

protected static void echoUsage()
Delivers usage instructions when the program is invoked with no arguments.


processArgs

protected static void processArgs(java.lang.String[] args)
Process the command line to


DocCheck 1.2 Beta 2

Report a bug or suggest a feature
Copyright 2000-2003 Sun Microsystems, Inc. 4150 Network Circle
Santa Clara, CA 95054, U.S.A. All Rights Reserved.