public class ClassPath extends Object
| Constructor and Description |
|---|
ClassPath(List<File> elements)
Creates a new ClassPath.
|
ClassPath(String text)
Creates a new ClassPath.
|
| Modifier and Type | Method and Description |
|---|---|
File |
getFirstMatch(TypeName name)
Returns the first match for
name in the class path. |
static void |
main(String[] args)
Tests ClassPath.
|
InputStream |
openClass(TypeName name)
Reads the supplied class path looking for the class
name. |
String |
toString() |
public ClassPath(List<File> elements)
elements - the paths to be used to search for classesIllegalArgumentException - if elements is nullpublic ClassPath(String text)
text - the String representation of the classpathIllegalArgumentException - if text is nullpublic File getFirstMatch(TypeName name) throws IOException
name in the class path. The class may be packed within
a zip or jar file.name - the class nameIOException - if an I/O error occurs while reading a zip or jar filepublic InputStream openClass(TypeName name) throws ClassNotFoundException, IOException
name.
Returns the InputStream to the class. (The class may be packed within
a Zip or Jar file).name - this may be any of the canonical styles of class namingClassNotFoundException - if no matching class can be found.IOException - if an error occurs while locating the class filepublic static void main(String[] args)
args - the command-line argumentCopyright © 2012. All Rights Reserved.