Top Description Methods
javassist

public Interface ClassPath

Known Direct Implementers
javassist.DirClassPath, javassist.JarDirClassPath, javassist.JarClassPath, javassist.LoaderClassPath, javassist.URLClassPath, javassist.ByteArrayClassPath, javassist.ClassClassPath
Imports
java.io.InputStream, java.net.URL

ClassPath is an interface implemented by objects representing a class search path. ClassPool uses those objects for reading class files.

The users can define a class implementing this interface so that a class file is obtained from a non-standard source.

See Also
ClassPool#insertClassPath(ClassPath), ClassPool#appendClassPath(ClassPath), ClassPool#removeClassPath(ClassPath)

Method Summary

Modifier and TypeMethod and Description
public URL

Returns:

null if the specified class file could not be found.
find
(String
a fully-qualified class name.
classname
)

Returns the uniform resource locator (URL) of the class file with the specified name.

public InputStream

Returns:

the input stream for reading a class file
openClassfile
(String
a fully-qualified class name
classname
)

Opens a class file.

Method Detail

findback to summary
public URL find(String classname)

Returns the uniform resource locator (URL) of the class file with the specified name.

Parameters
classname:String

a fully-qualified class name.

Returns:URL

null if the specified class file could not be found.

openClassfileback to summary
public InputStream openClassfile(String classname) throws NotFoundException

Opens a class file. This method may be called just to examine whether the class file exists as well as to read the contents of the file.

This method can return null if the specified class file is not found. If null is returned, the next search path is examined. However, if an error happens, this method must throw an exception so that the search will be terminated.

This method should not modify the contents of the class file.

Parameters
classname:String

a fully-qualified class name

Returns:InputStream

the input stream for reading a class file

See Also
javassist.Translator