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)
- 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)
- 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)
- list of super classes of clazz in ascending order, i.e.,
Object is always the last element. return "null", if class
cannot be found.
getSuperClasses
public static JavaClass[] getSuperClasses(JavaClass clazz)
- 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)
- true, if clazz is an implementation of interface inter
implementationOf
public static boolean implementationOf(String clazz,
JavaClass inter)
- true, if clazz is an implementation of interface inter
implementationOf
public static boolean implementationOf(JavaClass clazz,
String inter)
- true, if clazz is an implementation of interface inter
implementationOf
public static boolean implementationOf(JavaClass clazz,
JavaClass inter)
- true, if clazz is an implementation of interface inter
instanceOf
public static boolean instanceOf(String clazz,
String super_class)
- true, if clazz is an instance of super_class
instanceOf
public static boolean instanceOf(String clazz,
JavaClass super_class)
- true, if clazz is an instance of super_class
instanceOf
public static boolean instanceOf(JavaClass clazz,
String super_class)
- true, if clazz is an instance of super_class
instanceOf
public static boolean instanceOf(JavaClass clazz,
JavaClass super_class)
Equivalent to runtime "instanceof" operator.
- true, if clazz is an instance of super_class
lookupClass
public static JavaClass lookupClass(Class clazz)
Try to find class source via getResourceAsStream().
- JavaClass object for given runtime class
lookupClass
public static JavaClass lookupClass(String class_name)
Lookup class somewhere found on your CLASSPATH, or whereever the
repository instance looks for it.
- class object for given fully qualified class name, or null
if the class could not be found or parsed correctly
lookupClassFile
public static ClassPath.ClassFile lookupClassFile(String class_name)
- class file object for given Java class.
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