public class PackageClasses extends Object
Constructor and Description |
---|
PackageClasses(String classpath)
Creates an instance with the specified class path.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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 pathIOException
- if a problem occurs accessing files in the class
pathpublic static void main(String[] args) throws IOException
args
- the argumentsIllegalArgumentException
- if less than one or more than two
arguments are providedIOException
- if an I/O error occurspublic Set compute(String[] packages) throws IOException
packages
- the packagesIOException
- 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 packagesIOException
- 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 packageIOException
- if a problem occurs accessing files in the class
pathCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.