javassist

Class ByteArrayClassPath

public class ByteArrayClassPath extends Object implements ClassPath

A ByteArrayClassPath contains bytes that is served as a class file to a ClassPool. It is useful to convert a byte array to a CtClass object.

For example, if you want to convert a byte array b into a CtClass object representing the class with a name classname, then do as following:

The ClassPool object cp uses the created ByteArrayClassPath object as the source of the class file.

A ByteArrayClassPath must be instantiated for every class. It contains only a single class file.

See Also: ClassPath insertClassPath appendClassPath ClassPool

Constructor Summary
ByteArrayClassPath(String name, byte[] classfile)
Method Summary
voidclose()
Closes this class path.
URLfind(String classname)
Obtains the URL.
InputStreamopenClassfile(String classname)
Opens the class file.
StringtoString()

Constructor Detail

ByteArrayClassPath

public ByteArrayClassPath(String name, byte[] classfile)

Method Detail

close

public void close()
Closes this class path.

find

public URL find(String classname)
Obtains the URL.

openClassfile

public InputStream openClassfile(String classname)
Opens the class file.

toString

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