|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavassist.URLClassPath
public class URLClassPath
A class search-path specified with URL (http).
ClassPath,
ClassPool.insertClassPath(ClassPath),
ClassPool.appendClassPath(ClassPath)| Field Summary | |
|---|---|
protected String |
directory
|
protected String |
hostname
|
protected String |
packageName
|
protected int |
port
|
| Constructor Summary | |
|---|---|
URLClassPath(String host,
int port,
String directory,
String packageName)
Creates a search path specified with URL (http). |
|
| Method Summary | |
|---|---|
void |
close()
Closes this class path. |
static byte[] |
fetchClass(String host,
int port,
String directory,
String classname)
Reads a class file on an http server. |
URL |
find(String classname)
Returns the URL. |
InputStream |
openClassfile(String classname)
Opens a class file with http. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String hostname
protected int port
protected String directory
protected String packageName
| Constructor Detail |
|---|
public URLClassPath(String host,
int port,
String directory,
String packageName)
This search path is used only if a requested
class name starts with the name specified by packageName.
If packageName is "org.javassist." and a requested class is
"org.javassist.test.Main", then the given URL is used for loading that class.
The URLClassPath obtains a class file from:
http://www.javassist.org:80/java/classes/org/javassist/test/Main.class
Here, we assume that host is "www.javassist.org",
port is 80, and directory is "/java/classes/".
If packageName is null, the URL is used
for loading any class.
host - host nameport - port numberdirectory - directory name ending with "/".
It can be "/" (root directory).
It must start with "/".packageName - package name. It must end with "." (dot).| Method Detail |
|---|
public String toString()
toString in class Objectpublic InputStream openClassfile(String classname)
openClassfile in interface ClassPathclassname - a fully-qualified class name
Translatorpublic URL find(String classname)
find in interface ClassPathclassname - a fully-qualified class name.
public void close()
close in interface ClassPath
public static byte[] fetchClass(String host,
int port,
String directory,
String classname)
throws IOException
host - host nameport - port numberdirectory - directory name ending with "/".
It can be "/" (root directory).
It must start with "/".classname - fully-qualified class name
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||