The repository maintains informations about class interdependencies, e.g.,
whether a class is a sub-class of another. Delegates actual class loading
to SyntheticRepository with current class path by default.
addClass
public static JavaClass addClass(JavaClass clazz)
Add clazz to repository if there isn't an equally named class already in there.
clearCache
public static void clearCache()
Clear the repository.
getInterfaces
public static JavaClass[] getInterfaces(String class_name)
throws ClassNotFoundException
- all interfaces implemented by class and its super
classes and the interfaces that extend those interfaces, and so on
getInterfaces
public static JavaClass[] getInterfaces(JavaClass clazz)
throws ClassNotFoundException
- all interfaces implemented by class and its super
classes and the interfaces that those interfaces extend, and so on.
(Some people call this a transitive hull).
getRepository
public static Repository getRepository()
- currently used repository instance
getSuperClasses
public static JavaClass[] getSuperClasses(String class_name)
throws ClassNotFoundException
- list of super classes of clazz in ascending order, i.e.,
Object is always the last element.
getSuperClasses
public static JavaClass[] getSuperClasses(JavaClass clazz)
throws ClassNotFoundException
- list of super classes of clazz in ascending order, i.e.,
Object is always the last element
implementationOf
public static boolean implementationOf(String clazz,
String inter)
throws ClassNotFoundException
- true, if clazz is an implementation of interface inter
implementationOf
public static boolean implementationOf(String clazz,
JavaClass inter)
throws ClassNotFoundException
- true, if clazz is an implementation of interface inter
implementationOf
public static boolean implementationOf(JavaClass clazz,
String inter)
throws ClassNotFoundException
- true, if clazz is an implementation of interface inter
implementationOf
public static boolean implementationOf(JavaClass clazz,
JavaClass inter)
throws ClassNotFoundException
- true, if clazz is an implementation of interface inter
instanceOf
public static boolean instanceOf(String clazz,
String super_class)
throws ClassNotFoundException
- true, if clazz is an instance of super_class
instanceOf
public static boolean instanceOf(String clazz,
JavaClass super_class)
throws ClassNotFoundException
- true, if clazz is an instance of super_class
instanceOf
public static boolean instanceOf(JavaClass clazz,
String super_class)
throws ClassNotFoundException
- true, if clazz is an instance of super_class
instanceOf
public static boolean instanceOf(JavaClass clazz,
JavaClass super_class)
throws ClassNotFoundException
Equivalent to runtime "instanceof" operator.
- true, if clazz is an instance of super_class
lookupClass
public static JavaClass lookupClass(Class clazz)
throws ClassNotFoundException
Try to find class source using the internal repository instance.
- JavaClass object for given runtime class
lookupClass
public static JavaClass lookupClass(String class_name)
throws ClassNotFoundException
Lookup class somewhere found on your CLASSPATH, or whereever the
repository instance looks for it.
- class object for given fully qualified class name
lookupClassFile
public static ClassPath.ClassFile lookupClassFile(String class_name)
- class file object for given Java class by looking on the
system class path; returns null if the class file can't be
found
removeClass
public static void removeClass(String clazz)
Remove class with given (fully qualified) name from repository.
removeClass
public static void removeClass(JavaClass clazz)
Remove given class from repository.
setRepository
public static void setRepository(Repository rep)
Set repository instance to be used for class loading