javassist

Class ClassClassPath

public class ClassClassPath extends Object implements ClassPath

A search-path for obtaining a class file by getResourceAsStream() in java.lang.Class.

Try adding a ClassClassPath when a program is running with a user-defined class loader and any class files are not found with the default ClassPool. For example,

This code snippet permanently adds a ClassClassPath to the default ClassPool. Note that the default ClassPool is a singleton. The added ClassClassPath uses a class object representing the class including the code snippet above.

See Also: insertClassPath appendClassPath LoaderClassPath

Constructor Summary
ClassClassPath(Class c)
Creates a search path.
Method Summary
voidclose()
Does nothing.
URLfind(String classname)
Obtains the URL of the specified class file.
InputStreamopenClassfile(String classname)
Obtains a class file by getResourceAsStream().
StringtoString()

Constructor Detail

ClassClassPath

public ClassClassPath(Class c)
Creates a search path.

Parameters: c the Class object used to obtain a class file. getResourceAsStream() is called on this object.

Method Detail

close

public void close()
Does nothing.

find

public URL find(String classname)
Obtains the URL of the specified class file.

Returns: null if the class file could not be found.

openClassfile

public InputStream openClassfile(String classname)
Obtains a class file by getResourceAsStream().

toString

public String toString()
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.