com.sun.jini.tool.classdepend
Class PackageClasses

java.lang.Object
  extended by com.sun.jini.tool.classdepend.PackageClasses

public class PackageClasses
extends Object

Utility class for finding the names of the classes in a set of packages.


Constructor Summary
PackageClasses(String classpath)
          Creates an instance with the specified class path.
 
Method Summary
 Set compute(boolean recurse, String packAge)
          Returns a set of the fully qualified names of classes in the specified packages, optionally including classes in subpackages of those packages.
 Set compute(boolean recurse, String[] packages)
          Returns a set of the fully qualified names of classes in the specified packages, optionally including classes in subpackages of those packages.
 Set compute(String packAge)
           
 Set compute(String[] packages)
          Returns a set of the fully qualified names of classes in the specified packages, not including classes in subpackages of those packages.
static void main(String[] args)
          Prints the classes in a package in the class path to standard output using the default character encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageClasses

public PackageClasses(String classpath)
               throws IOException
Creates an instance with the specified class path. The class path is interpreted as a list of file names, separated by the File.pathSeparator character. Empty names are treated as the current directory, names ending in the File.separator character are treated as directories, and other names are treated as JAR files.

Parameters:
classpath - the class path
Throws:
IOException - if a problem occurs accessing files in the class path
Method Detail

main

public static void main(String[] args)
                 throws IOException
Prints the classes in a package in the class path to standard output using the default character encoding. If second argument is specified, it is used as the class path, otherwise the system class path is used.

Parameters:
args - the arguments
Throws:
IllegalArgumentException - if less than one or more than two arguments are provided
IOException - if an I/O error occurs

compute

public Set compute(String[] packages)
            throws IOException
Returns a set of the fully qualified names of classes in the specified packages, not including classes in subpackages of those packages.

Parameters:
packages - the packages
Returns:
the class names
Throws:
IOException - if a problem occurs accessing files in the class path

compute

public Set compute(String packAge)
            throws IOException
Throws:
IOException

compute

public Set compute(boolean recurse,
                   String[] packages)
            throws IOException
Returns a set of the fully qualified names of classes in the specified packages, optionally including classes in subpackages of those packages.

Parameters:
recurse - if true, find classes in subpackages of the specified packages
packages - the packages
Returns:
the class names
Throws:
IOException - if a problem occurs accessing files in the class path

compute

public Set compute(boolean recurse,
                   String packAge)
            throws IOException
Returns a set of the fully qualified names of classes in the specified packages, optionally including classes in subpackages of those packages.

Parameters:
recurse - if true, find classes in subpackages of the specified package
packAge - the package
Returns:
the class names
Throws:
IOException - if a problem occurs accessing files in the class path


Copyright 2007, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.