To get the CtClass
from a class file you can use the method ClassPool.makeClass
. This method takes as an argument an input stream from which it reads the class file.
import javassist.ClassPool;
import javassist.CtClass;
ClassPool pool = ClassPool.getDefault();
CtClass ctClass = pool.makeClass(new FileInputStream("pathTo\Test.class"));
System.out.println(ctClass);