Methods Summary |
---|
public static com.sun.org.apache.bcel.internal.classfile.JavaClass | addClass(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz)Add clazz to repository if there isn't an equally named class already in there.
JavaClass old = _repository.findClass(clazz.getClassName());
_repository.storeClass(clazz);
return old;
|
public static void | clearCache()Clear the repository.
_repository.clear();
|
public static com.sun.org.apache.bcel.internal.classfile.JavaClass[] | getInterfaces(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz)
return clazz.getAllInterfaces();
|
public static com.sun.org.apache.bcel.internal.classfile.JavaClass[] | getInterfaces(java.lang.String class_name)
return getInterfaces(lookupClass(class_name));
|
public static com.sun.org.apache.bcel.internal.util.Repository | getRepository()
return _repository;
|
public static com.sun.org.apache.bcel.internal.classfile.JavaClass[] | getSuperClasses(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz)
return clazz.getSuperClasses();
|
public static com.sun.org.apache.bcel.internal.classfile.JavaClass[] | getSuperClasses(java.lang.String class_name)
JavaClass jc = lookupClass(class_name);
return (jc == null? null : getSuperClasses(jc));
|
public static boolean | implementationOf(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz, com.sun.org.apache.bcel.internal.classfile.JavaClass inter)
return clazz.implementationOf(inter);
|
public static boolean | implementationOf(java.lang.String clazz, java.lang.String inter)
return implementationOf(lookupClass(clazz), lookupClass(inter));
|
public static boolean | implementationOf(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz, java.lang.String inter)
return implementationOf(clazz, lookupClass(inter));
|
public static boolean | implementationOf(java.lang.String clazz, com.sun.org.apache.bcel.internal.classfile.JavaClass inter)
return implementationOf(lookupClass(clazz), inter);
|
public static boolean | instanceOf(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz, com.sun.org.apache.bcel.internal.classfile.JavaClass super_class)Equivalent to runtime "instanceof" operator.
return clazz.instanceOf(super_class);
|
public static boolean | instanceOf(java.lang.String clazz, java.lang.String super_class)
return instanceOf(lookupClass(clazz), lookupClass(super_class));
|
public static boolean | instanceOf(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz, java.lang.String super_class)
return instanceOf(clazz, lookupClass(super_class));
|
public static boolean | instanceOf(java.lang.String clazz, com.sun.org.apache.bcel.internal.classfile.JavaClass super_class)
return instanceOf(lookupClass(clazz), super_class);
|
public static com.sun.org.apache.bcel.internal.classfile.JavaClass | lookupClass(java.lang.String class_name)Lookup class somewhere found on your CLASSPATH, or whereever the
repository instance looks for it.
try {
JavaClass clazz = _repository.findClass(class_name);
if(clazz == null) {
return _repository.loadClass(class_name);
} else {
return clazz;
}
} catch(ClassNotFoundException ex) { return null; }
|
public static com.sun.org.apache.bcel.internal.classfile.JavaClass | lookupClass(java.lang.Class clazz)Try to find class source via getResourceAsStream().
try {
return _repository.loadClass(clazz);
} catch(ClassNotFoundException ex) { return null; }
|
public static ClassPath.ClassFile | lookupClassFile(java.lang.String class_name)
try {
return ClassPath.SYSTEM_CLASS_PATH.getClassFile(class_name);
} catch(IOException e) { return null; }
|
public static void | removeClass(java.lang.String clazz)Remove class with given (fully qualified) name from repository.
_repository.removeClass(_repository.findClass(clazz));
|
public static void | removeClass(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz)Remove given class from repository.
_repository.removeClass(clazz);
|
public static void | setRepository(com.sun.org.apache.bcel.internal.util.Repository rep)Set repository instance to be used for class loading
_repository = rep;
|