|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.tool.classdepend.PackageClasses
public class PackageClasses
Utility class for finding the names of the classes in a set of packages.
Field Summary | |
---|---|
private Set |
directories
The names of directories in the classpath. |
private Set |
jarContents
The names of files in JAR files in the classpath. |
Constructor Summary | |
---|---|
PackageClasses(String classpath)
Creates an instance with the specified class path. |
Method Summary | |
---|---|
private static void |
collectClasses(File directory,
boolean recurse,
String pkg,
Set classes)
Adds the names of classes in the directory to the set of classes, recursiving into subdirectories if requested. |
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. |
private static String |
removeDotClass(String s)
Strips the .class suffix from a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Set directories
private final Set jarContents
Constructor Detail |
---|
public PackageClasses(String classpath) throws IOException
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.
classpath
- the class path
IOException
- if a problem occurs accessing files in the class
pathMethod Detail |
---|
public static void main(String[] args) throws IOException
args
- the arguments
IllegalArgumentException
- if less than one or more than two
arguments are provided
IOException
- if an I/O error occurspublic Set compute(String[] packages) throws IOException
packages
- the packages
IOException
- if a problem occurs accessing files in the class
pathpublic Set compute(String packAge) throws IOException
IOException
public Set compute(boolean recurse, String[] packages) throws IOException
recurse
- if true
, find classes in subpackages of
the specified packagespackages
- the packages
IOException
- if a problem occurs accessing files in the class
pathpublic Set compute(boolean recurse, String packAge) throws IOException
recurse
- if true
, find classes in subpackages of
the specified packagepackAge
- the package
IOException
- if a problem occurs accessing files in the class
pathprivate static void collectClasses(File directory, boolean recurse, String pkg, Set classes) throws IOException
IOException
private static String removeDotClass(String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |